Another fairly slick way to do this would be to list the GDG base and then parse out the LIMIT. You could then go directly to the file XXXX.XXXX.XXXX(-00"LIMIT-1") which should be the oldest file. This is all assuming that you have created enough files to reach the limit.
-----Original Message----- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of John McKown Sent: Tuesday, November 17, 2015 1:45 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: Fastest way to read OLDEST GDG entry Some example REXX which might be of some help: /* REXX */ X=OUTTRAP("OUT.","*"); "LISTC ENT('gdg.base.name') ALL" X=OUTTRAP("OFF") DSN='?' DO I=1 TO OUT.0 IF 'NONVSAM-' <> LEFT(STRIP(OUT.I,'L'),8) THEN ITERATE DSN=WORD(TRANSLATE(OUT.I,' ','-'),2) LEAVE END IF DSN='?' THEN EXIT(12) /* NO DSN FOUND */ "RECEIVE INDATASET('"DSN"')" I recall that doing a RECEIVE in REXX is "iffy". Perhaps another person remembers how to do this? -- Schrodinger's backup: The condition of any backup is unknown until a restore is attempted. Yoda of Borg, we are. Futile, resistance is, yes. Assimilated, you will be. He's about as useful as a wax frying pan. 10 to the 12th power microphones = 1 Megaphone Maranatha! <>< John McKown ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN