Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Improve ISAM I-O performance

Status
Not open for further replies.
M

Member 310024

Guest
MF COBOL 4.5 MSWXP
I have an ISAM file with over 1 million records and I am not happy with the READ DIRECT (on primary key) performance.
With some data-bases (eg HP-Image), you can get the records physically closer ( hence avoiding seek time and rotational delay), by doing an unload/reload which "packs" them back together, and avoids long pointer paths.
Would this work with the XP operating system, or could I end up with just as much fragmentation as I have now?
Alternatively, is there some other thing I can do to speed up I-O. I suspect the BLOCK CONTAINS clause doesn't work on the PC. Thanks in advance.


 
I assume this is PC I/O on an sequential Indexed file?

What is the target platform of the product in question? MF COBOL 4.5? DOS? Win16? Win32?

How is the file defined in your program?

Then we can work from there on how to change I/O. And yes, BLOCK CONTAINS likely will change your I/O performance.
 
Microfocus COBOL Version 4.5
Win32 Microsoft XP
Development in Command Line Interface ("DOS")
I will send various bits of the code, but how do I put
it in my reply, in the nice "window boxes" that other people put their code in?
If I cut/paste the code, it looses(sic?) it's aligment & gets wrap-around, which makes it pretty-well unreadable.
 
Ok, I got it!
Here's the code.


Code:
000051*                                                    
000052     SELECT I55001-FILE ASSIGN WW-I55001-FILE-LOCN   
000053     ORGANIZATION INDEXED                            
000054     ACCESS       DYNAMIC                            
000055     LOCK MODE IS MANUAL                             
000056     RECORD    KEY IS I55001-K1                      
000057     ALTERNATE KEY IS I55001-K2                      
000058     FILE STATUS   IS WW-FILE-STATUS.                
000059*                                                    

000069*                                                 
000070 FD  I55001-FILE.                                 
000071 01  I55001-RECORD.                               
000072*                                                 
000073     03  I55001-K1.                               
000074         05  I55001-K1-CYL           PIC 9(09).   
000075         05  I55001-K1-REAL-CHAR     PIC X(01).   
000076*                                                 
000077     03  I55001-K2.                               
000078         05  I55001-K2-CYL           PIC 9(09).   
000079         05  I55001-K2-ENCR-CHAR     PIC X(01).   
000080*                                                 
000081     03  I55001-DATA.                             
000082         05  I55001-CYL              PIC 9(09).   
000083         05  I55001-REAL-CHAR        PIC X(01).   
000084         05  I55001-ENCR-CHAR        PIC X(01).   
000085*                                                 

000769*                                           
000770 2000-PROCESS SECTION.                      
000771*                                           
000772     MOVE '2000-PROCESS' TO WO-MODULE.      
000773*                                           
000774 CONTROL-PARAGRAPH.                         
000775*                                           
000776     PERFORM X-READ-L001.                   
000777     IF WF-EOF-L001 = 'Y'                   
000778         GO TO EXIT-PARAGRAPH               
000779     END-IF.                                
000780     ADD 1 TO WW-RECORDS-READ-L001.         
000781*                                           
000782     MOVE L001-RECORD TO WW-REAL-REC.       
000783     MOVE L001-RECORD TO WW-ENCR-REC.       
000784*                                           
000785     PERFORM 2100-ENCRYPT-NEXT-CHAR         
000786         VARYING WS-SUB FROM 1 BY 1         
000787             UNTIL WS-SUB > 80.
000788*                                            
000789     MOVE WW-ENCR-REC TO L002-RECORD.        
000790     PERFORM X-WRITE-L002.                   
000791*                                            
000792     PERFORM X-DISPLAY-INFO-SCREEN.          
000793*                                            
000794**** DISPLAY WW-RECORDS-READ-L001 AT 1235.   
000795*                                            
000796 EXIT-PARAGRAPH.                             
000797     EXIT.                                   


001722*            
001723 X-READ-DIRECT-I55001-K1 SECTION.                    
001724*   
001725 CONTROL-PARAGRAPH.                          
001726*                
001727     MOVE 'X-READ-DIRECT-I55001-K1' TO WO-X-DBIO-MODULE.          
001728     MOVE 'I55001-FILE'             TO WO-SELECT-FILE.            
001729     MOVE WW-I55001-FILE-LOCN       TO WO-ASSIGN-FILE.            
001730*                                                                 
001731     MOVE 'Y' TO WF-VALID.                                        
001732     MOVE 'Y' TO WF-FOUND-I55001.                                 
001733     READ I55001-FILE RECORD                                      
001734         KEY IS I55001-K1                                         
001735         INVALID                                                  
001736             MOVE 'N' TO WF-VALID                                 
001737             MOVE 'N' TO WF-FOUND-I55001                          
001738     END-READ.                                                    
001739*                                                                 
001740     IF FATAL-ERROR                                        
001741         PERFORM X-FILE-STATUS-MSG                         
001742         PERFORM X-SHOW-EXPLANATION                        
001743         PERFORM X-CLOSE                                   
001744         GO TO Z-TERMINATE                                 
001745     END-IF.                                               
001746*                                                          
001747 EXIT-PARAGRAPH.                                           
001748     EXIT.
 
The REBUILD utility included with Micro Focus COBOL will also do this function.
 
The biggest problem is the separate index file with MF. You can hear the access: the head of the drive is repositioning every time again. When you run the same job with CA-REALIA, it is much faster.

To make MF faster, you can try to put the file on a RAM-disk. Then there is no head repositioning....
 
You can also increase the buffer size. The environment variables EXTFHBUF and IDXDATBUF control the buffer sizes. EXTFHBUF is for the index file and IDXDATBUF is for the data file. The value for IDXDATBUF defaults to zero. If the file has been reorganized to be in key sequence, increasing its value will improve access speed. Both variables must be set in increments of 4096. Use the dos SET command as follows:
SET EXTFHBUF=8192
SET IDXDATBUF=8192
You can also run the programs under XM, the Micro Focus extended memory manager. Also, having the files on a file server can improve access speed, if the sever has enough ram.

To get the nice boxes as above, use TGML. Click on "Process TGML" below the text window to learn how to use it. Be sure the box next to it is checked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top