View previous topic :: View next topic
|
Author |
Message |
sheersh
New User
Joined: 24 May 2008 Posts: 17 Location: Gurgaon
|
|
|
|
Hi,
Is it possible to read subsequent records of the file without having 'GET' in the loop. I mean if it is possible to point a register in the start of record and keep bumping with the record length for next record read. ...... But again even if this is possible, How would i detect end of file.
Please advise. Thanks! |
|
Back to top |
|
|
Ronald Burr
Active User
Joined: 22 Oct 2009 Posts: 293 Location: U.S.A.
|
|
|
|
If you are using GET, then it would NOT be a good idea to even THINK about doing your own record address manipulation, since any subsequent request for I/O via a GET macro will lead to overlaps in record processing ( i.e. the OS will not know that YOU did any adjustments for processing, and the next GET will retrieve the next record after the last one returned by the OS, NOT the next record after the last one processed by YOU ).
If you want to do your own record processing, switch to "block" mode READ with CHECK or WAIT ( for physical I/O ), and then use a roll-your-own routine for deblocking. You will have to test for EOF in two ways: 1) when the last block is a "full" block (EODAD addr coded in DCB); and 2) when the last block is a "short" block (detected in your own deblocking code).
If efficiency is your concern, perhaps a simple change of your MACRF from GM ( Get/Move ) to GL ( Get/Locate ) would help by eliminating the MOVE of data from the buffer to your defined storage area. Just adjust your code to change the MACRF, eliminate the target addr in the GET instruction, and use the address returned in Register 1 as the pointer to the record. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Why are you even considering this? It will not save i/o. . .
When you GET a record it is a logical record. Physical reads are done "outside" your code.
Quote: |
Please advise. Thanks! |
Don't do that |
|
Back to top |
|
|
|