I am trying with the below code , but it is giving later version code , I tried giving Dataset.GDG(-2) but gives me error. Do i need to change anything below.
/* REXX */
PARSE UPPER PULL GDG
DSN = STRIP(GDG!!".G0000V00") /* DEFAULT IF NOT EXIST */
X=OUTTRAP(LST.) /* LISTCAT GDG BASE */
" LISTC ENT('"GDG"')"
X=OUTTRAP(OFF)
DO A = LST.0 TO 1 BY -1 /* FIRST FIND = 0 GDG */
IF POS('NONVSAM',LST.A) > 0 THEN DO
DSN = SUBSTR(LST.A,POS('NONVSAM',LST.A)+13,44)
A = 0
END
END
SAY "GDG=" GDG
SAY "DSN =" DSN
GDG1= SUBSTR(DSN,19,8)
QUEUE GDG1
"EXECIO "QUEUED() "DISKW OUTSRCH (FINIS"
PARSE UPPER PULL GDG
DSN = STRIP(GDG!!".G0000V00") /* DEFAULT IF NOT EXIST */
X=OUTTRAP(LST.) /* LISTCAT GDG BASE */
" LISTC ENT('"GDG"')"
X=OUTTRAP(OFF)
DO A = LST.0 TO 1 BY -1 /* FIRST FIND = 0 GDG */
IF POS('NONVSAM',LST.A) > 0 THEN DO
DSN = SUBSTR(LST.A,POS('NONVSAM',LST.A)+13,44)
A = 0
END
END
SAY "GDG=" GDG
SAY "DSN =" DSN
GDG1= SUBSTR(DSN,19,8)
QUEUE GDG1
"EXECIO "QUEUED() "DISKW OUTSRCH (FINIS"