If you know the record IDs are "regular format" (meaning the CCHH part always 
equals the CCHH of the track on which the records are stored and the R part is 
monotonically increasing), then you can easily read the records on the track 
backwards by doing direct reads of R(n), R(n-1), ..., R(1).  Of course, this 
method will require n revolutions of the device on ancient non-cached devices.  
On modern devices, the first access will cause the whole track to be cached, so 
only one revolution will be necessary, the same as if you read the whole track 
into storage with a modern command like Read Track and then work backwards 
through the data in storage.  Working backwards will be straightforward if the 
record lengths are regular (key lengths all the same and data lengths all the 
same).  Otherwise you will first have to scan forward through the track buffer, 
find the beginning of each record, save its offset in a table, and then process 
the records in reverse order starting with the !
 last entry in the table.

Bill Fairchild
Rocket Software

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@bama.ua.edu] On Behalf Of 
Shmuel Metz (Seymour J.)
Sent: Wednesday, July 13, 2011 1:19 PM
To: IBM-MAIN@bama.ua.edu
Subject: Re: Startio

In <p06240807ca42c258b562@[192.168.1.11]>, on 07/12/2011
   at 11:42 PM, "Robert A. Rosenberg" <hal9...@panix.com> said:

>Working with EXCP is fun at times. I once had to write a routine to 
>simulate doing READ BACKWARDS from tape by accessing the file from DASD 
>(to allow reading an archive log so I could do data back-out). I  used 
>EXCP to read the CKD field

ITYM the count field. Unless it was a really old device, it would have been 
easier to just read the entire track.
 
-- 
     Shmuel (Seymour J.) Metz, SysProg and JOAT
     ISO position; see <http://patriot.net/~shmuel/resume/brief.html>
We don't care. We don't have to care, we're Congress.
(S877: The Shut up and Eat Your spam act of 2003)

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to 
lists...@bama.ua.edu with the message: GET IBM-MAIN INFO Search the archives at 
http://bama.ua.edu/archives/ibm-main.html

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to