REXX – READ THE DSN PROVIDED AS DD IN JCL
When you execute your REXX EXEC in batch mode, suppose you want to use the file already created in the EXEC by passing it using the JCL (Not through Arguments, but by DD DSN), you can make use of below JCL.
//STEP02 EXEC PGM=IKJEFT01,PARM=(‘%READFL2’)
//SYSPROC DD DSN=YOUR.REXX.EXEC,DISP=SHR
//DD1 DD DSN=YOUR.INPUT.FILE,DISP=SHR
//SYSTSPRT DD SYSOUT=A
//SYSTSIN DD DUMMY
Here READFL2 is your EXEC which will read the dataset YOUR.INPUT.FILE using the DD name provided DD1.
Below I have provided the code for the EXEC READFL2. This EXEC reads the file and displays all the lines in the FILE.
/** REXX **/
“EXECIO * DISKR DD1(STEM AR. FINIS”
DO I = 1 TO AR.0