I saved to a temp file dsname from REXX.
Show us your JCL.
How to "read that file in the next step (using dynamic allocation on the data set)" ?
In the first step, use NEW,PASS. In the second step, use OLD,PASS. Specify the same temp data set name:
//SUPERC EXEC PGM=ISRSUPC,PARM=(DELTAL,LINECMP,'','')
//NEWDD DD DSN=&SYSUID..OLDFILE,DISP=SHR
//OLDDD DD DSN=&SYSUID..NEWFILE,DISP=SHR
//OUTDD DD DSN=&&TEMP0,UNIT=SYSVIO,DISP=(NEW,PASS)
//STEP2 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DISP=(OLD,PASS),DSN=&&TEMP0
//SYSUT2 DD SYSOUT=H
//SYSIN DD DUMMY
It is not clear how you were planning on reading it: however you do it, you need to refer to the DD name. In the above example, you would need to refer to SYSUT1.