by Robert Sample » Thu Nov 24, 2011 6:08 pm
One of the issues is what kind of file are you reading -- VSAM KSDS? VSAM ESDS? VSAM RRDS? Something else? IF the file is VSAM KSDS, and the key is the account number, one way would be to store the first and last account numbers you are displaying in the map -- place them in DFHCOMMAREA so they are retained across transactions. If someone hits the PF8 key, then you take the last account number and start browsing the file from that key. You may make it the first line of the new map, or you may just read the next record and use it for the first line. If someone hits the PF7 key, then you take the first account number and start browsing from that key, then use READPREV to backfill the map lines.
Another way would be to build a TS queue and store the item number for the map lines in DFHCOMMAREA. There are other ways, of course.