Tuesday, December 6, 2011

Reading Sequential File Backwards

How a sequential file on a Disk can be read backwards starting from the last record. No sorting of records and then using read nexts etc..

Unfortunately, this cannot be done on sequential datasets on DASD. What you can do instead is :

1. Use FILEAID - COPYBACK option, and reverse the dataset.
  Read the dataset in the forward direction itself!

  OR

2. Copy the dataset to TAPE, and use the "REVERSE" option when you OPEN the dataset (OPEN INPUT filename WITH REVERSE) in the program.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.