I'm trying to list a VSAM file to get the "HI-U-RBA" and the "HI-A-RBA". I'm listing the file and writing it to a PS file. Through EXECIO * DISKR i'm reading it followed by a substr statement to find the required value and it goes as given below. To my surprise it's not capturing the required value. Instead its going for the last line. I tried to find the position still it says the particular string "HI-U-RBA" is not found(Returns 0). Can anyone guide me where do i go wrong please? Here is the code I'm using.
/*REXX*/
PULL DSN
X=OUTTRAP('RET.')
DSNF = STRIP(DSN)
"LISTC ENT('"DSNF"') ALL"
X=OUTTRAP=('OFF')
"EXECIO * DISKR OUTTR(STEM RET. FINIS"
DO IX=1 TO RET.0
VAR1 =SUBSTR(RET.IX,POS('HI-U-RBA',RET.IX)+14)
VAR2 =SUBSTR(RET.IX,POS('HI-A-RBA',RET.IX)+14)
END
SAY VAR1
SAY VAR2
PULL DSN
X=OUTTRAP('RET.')
DSNF = STRIP(DSN)
"LISTC ENT('"DSNF"') ALL"
X=OUTTRAP=('OFF')
"EXECIO * DISKR OUTTR(STEM RET. FINIS"
DO IX=1 TO RET.0
VAR1 =SUBSTR(RET.IX,POS('HI-U-RBA',RET.IX)+14)
VAR2 =SUBSTR(RET.IX,POS('HI-A-RBA',RET.IX)+14)
END
SAY VAR1
SAY VAR2