KB#00016-How to READ backwards after hitting the end of a mkeyed file
How to READ backwards after hitting the end of a mkeyed file
Once you've READ the last record in the file, the read "pointer" has been forced forward (past the last record), which is when you receive the ERROR 2-- "End of File". A READ(channel_num,dir=-1)IOL=100 can't change direction, since the pointer is not currently looking at a record.
The only solution is to grab the key to the last record with the KEYL() function and set "dir=0" to hold the pointer on that last record. The you can use "dir=-1" to walk backward through the file.
Last Modified: 12/17/1997 Product: PRO/5 Operating System: All platforms
BASIS structures five components of their technology into the BBx Generations.