Don't know about COBOL, but in assembler (batch) all you have to do to find the last record in a VSAM data set is issue the GET macro with the RPL pointed to by the GET macro containing the OPTCD=(LRD,BWD) parameter. See the "DFSMS Macro Instructions for Data Sets" manual -> "VSAM Macro Descriptions and Examples" chapter -> "RPL" topic. Regards, Ira In a message dated 2/8/2006 3:03:51 P.M. Central Standard Time, [EMAIL PROTECTED] writes:
In CICS you can do a STARTBR on a VSAM KSDS or ESDS file and then issue a READPREV to get the previous record from the key you started at. However, this function is not available to COBOL or IBM Assembler in batch. We have an issue where we need to know what the last RBA is in an ESDS file. It would be nice if we could do a STARTBR with a key of high-values and then do a READPREV. Has only via the mother of invention, found a way to do this that is fast? I know we could do a startbr at the begging or somewhere in the middle, do READNEXT saving off the keys until we hit EOF at which point the saved key would be the highest RBA. But we have a huge file and this way would take too much time. Thanks in advance for any suggestions. Steve Wiegand ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] 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 [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html

