I have never seen anything like this.
I have trimmed it to the essentials only, replacing my original macro (analysing the OUTDD listing of a ISRSUPC srchfor listing) with CANCEL.
It's a technique I have used successfully many times.
Here is the JCL generating and executing the REXX code...
//N472730T JOB (SJ,P),'SRCHFOR',CLASS=B,MSGCLASS=O,NOTIFY=&SYSUID
/*JOBPARM L=999
//*------- SYMBOLIC DISPS ---------------------------------------------
// SET DEL='(MOD,DELETE),SPACE=(TRK,0)'
// SET NCD='(NEW,CATLG,DELETE)'
// SET NDD='(NEW,DELETE,DELETE)'
// SET SPD='(SHR,PASS,DELETE)'
//*--------------------------------------------------------------------
//CLEANUP EXEC PGM=IEFBR14
//DEL001 DD DISP=&DEL,DSN=&SYSUID..TEMP.EXEC
//*--------------------------------------------------------------------
//PREALLOC EXEC PGM=IEFBR14
//TMPEXEC DD DISP=&NCD,DSN=&SYSUID..TEMP.EXEC,
// LRECL=80,RECFM=FB,BLKSIZE=32720,SPACE=(TRK,(5,5,1))
//*--------------------------------------------------------------------
//BATEDIT EXEC PGM=ICEGENER
//SYSUT2 DD DISP=SHR,DSN=&SYSUID..TEMP.EXEC(BATEDIT)
//SYSIN DD DUMMY
//SYSPRINT DD DUMMY
//SYSUT1 DD *
/*REXX*/
ARG dsn
SAY "DSN="dsn
TRACE "C"
ADDRESS ISPEXEC "EDIT DATASET("dsn") MACRO(CANCEL) "
SAY "RC="RC
SAY zerrsm
SAY zerrlm
EXIT
//*--------------------------------------------------------------------
//DSNEXEC EXEC PGM=IKJEFT01,
// PARM='ISPSTART CMD(BATEDIT TEMP.OUTDD)'
//SYSEXEC DD DISP=SHR,DSN=&SYSUID..TEMP.EXEC
//ISPPLIB DD DISP=SHR,DSN=SYS1.ISPPLIB
//ISPMLIB DD DISP=SHR,DSN=SYS1.ISPMLIB
//ISPSLIB DD DISP=SHR,DSN=SYS1.ISPSLIB
//ISPPROF DD DISP=&NDD,UNIT=VIO,SPACE=(3120,(3,3,3)),
// DCB=SYS1.ISPTLIB
//ISPTLIB DD DISP=&SPD,DSN=*.ISPPROF,VOL=REF=*.ISPPROF
// DD DISP=SHR,DSN=SYS1.ISPTLIB
//ISPTABL DD DISP=&SPD,DSN=*.ISPPROF,VOL=REF=*.ISPPROF
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
//*--------------------------------------------------------------------
//
/*JOBPARM L=999
//*------- SYMBOLIC DISPS ---------------------------------------------
// SET DEL='(MOD,DELETE),SPACE=(TRK,0)'
// SET NCD='(NEW,CATLG,DELETE)'
// SET NDD='(NEW,DELETE,DELETE)'
// SET SPD='(SHR,PASS,DELETE)'
//*--------------------------------------------------------------------
//CLEANUP EXEC PGM=IEFBR14
//DEL001 DD DISP=&DEL,DSN=&SYSUID..TEMP.EXEC
//*--------------------------------------------------------------------
//PREALLOC EXEC PGM=IEFBR14
//TMPEXEC DD DISP=&NCD,DSN=&SYSUID..TEMP.EXEC,
// LRECL=80,RECFM=FB,BLKSIZE=32720,SPACE=(TRK,(5,5,1))
//*--------------------------------------------------------------------
//BATEDIT EXEC PGM=ICEGENER
//SYSUT2 DD DISP=SHR,DSN=&SYSUID..TEMP.EXEC(BATEDIT)
//SYSIN DD DUMMY
//SYSPRINT DD DUMMY
//SYSUT1 DD *
/*REXX*/
ARG dsn
SAY "DSN="dsn
TRACE "C"
ADDRESS ISPEXEC "EDIT DATASET("dsn") MACRO(CANCEL) "
SAY "RC="RC
SAY zerrsm
SAY zerrlm
EXIT
//*--------------------------------------------------------------------
//DSNEXEC EXEC PGM=IKJEFT01,
// PARM='ISPSTART CMD(BATEDIT TEMP.OUTDD)'
//SYSEXEC DD DISP=SHR,DSN=&SYSUID..TEMP.EXEC
//ISPPLIB DD DISP=SHR,DSN=SYS1.ISPPLIB
//ISPMLIB DD DISP=SHR,DSN=SYS1.ISPMLIB
//ISPSLIB DD DISP=SHR,DSN=SYS1.ISPSLIB
//ISPPROF DD DISP=&NDD,UNIT=VIO,SPACE=(3120,(3,3,3)),
// DCB=SYS1.ISPTLIB
//ISPTLIB DD DISP=&SPD,DSN=*.ISPPROF,VOL=REF=*.ISPPROF
// DD DISP=SHR,DSN=SYS1.ISPTLIB
//ISPTABL DD DISP=&SPD,DSN=*.ISPPROF,VOL=REF=*.ISPPROF
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
//*--------------------------------------------------------------------
//
********************************* TOP OF DATA **********************************
DSN=TEMP.OUTDD
5 *-* ADDRESS ISPEXEC "VIEW DATASET("dsn") MACRO(CANCEL) "
>>> "VIEW DATASET(TEMP.OUTDD) MACRO(CANCEL) "
RC=0
INVALID SERVICE
'BROWSE' service not supported in the batch environment.
READY
END
******************************** BOTTOM OF DATA ********************************
DSN=TEMP.OUTDD
5 *-* ADDRESS ISPEXEC "VIEW DATASET("dsn") MACRO(CANCEL) "
>>> "VIEW DATASET(TEMP.OUTDD) MACRO(CANCEL) "
RC=0
INVALID SERVICE
'BROWSE' service not supported in the batch environment.
READY
END
******************************** BOTTOM OF DATA ********************************
confused!