The below code helps to print the spool out to the dataset.
FILTER command is used to uniquely select the job output when the job names are same.
FILTER works only together with AFD REFRESH command.
The program ISFAFD is the batch support for SDSF.
This REXX takes three inputs:
- JOBNAME
- JOBID
- OUTPUT Dataset Name
ARG JOBNAME JOBID TEMPFILE
ADDRESS TSO
"ALLOC F(ISFIN) TRACKS SPACE(1) REU" /* USED BY SDSF */
"ALLOC F(ISFOUT) NEW DELETE REU " , /* USED BY SDSF */
"TRACKS SPACE(100,100) LRECL(133) RECFM(F,B,A) DSORG(PS)"
"ALLOC F(TEMPPRT) DA('"TEMPFILE"("JOBID")')
SHR REUSE"
DROPBUF 0
QUEUE "PRE " JOBNAME /* SDSF COMMANDS IN BATCH*/
QUEUE "H"
QUEUE "FILTER JobID EQ "JOBID
QUEUE "AFD REFRESH"
QUEUE "SELECT "STRIP(JOBNAME) STRIP(JOBID)
QUEUE "++S"
QUEUE "PRINT FILE TEMPPRT" /* PRINT TO TEMP DATASET */
QUEUE "PRINT 1 999999"
QUEUE "PRINT CLOSE"
QUEUE "END"
"EXECIO" QUEUED()" DISKW ISFIN (FINIS" /* INPUT TO SDSF BATCH */
ADDRESS ISPEXEC "SELECT PGM(ISFAFD) PARM('++32,1000')"/* INVOKE SDSF */
"FREE FI(ISFIN)"
"FREE FI(ISFOUT)"
"FREE FI(TEMPPRT)"
RETURN 0