Is is possible to dump the contents of a JCL SYSOUT to a z/OS flat file?

I'm interested in knowing if it is possible to get the contents of a JCL SYSOUT into a z/OS flat file; either in the same JCL step or in a JCL step executed later in the same JCL.

Attention¡, I do not mean the other way round; which is generate the SYSOUT directy in a z/OS file and, after, in another JCL step dump it onto SYSOUT.

For example; in the following JCL step I'm interested in getting the contents of SYSOUT=2 in a flat file.

May anyone shed light in this issue?.

Many thanks in advance.

//WNMPRAD5 EXEC PGM=WNMPRAD5,COND=(4,LT)                     
//SYSPRINT DD SYSOUT=1                                       
//SYSDBOUT DD SYSOUT=1                                       
//ENTRADA  DD DSN=WNMT.SCADUC.WGPT022.ZXDALMA.UNLDBI,DISP=OLD
//SORTIDA  DD DSN=WNMT.SCADUC.WGPT022.ZXDALMA.OUTPUT.V02,    
//            DISP=(NEW,CATLG,DELETE),UNIT=DISK,             
//            DCB=(RECFM=FB,LRECL=278),                      
//            SPACE=(27998,(2500,2500),RLSE)                 
//SYSOUT   DD SYSOUT=2                                       
//SYSIN    DD *                                              
N0100                                                        
/*                                                           

Upvotes: 1

Views: 1770

Answers (3)

Neeraj Kumar
Neeraj Kumar

Reputation: 33

Provide the disposition parameter and dataset name in the sysout. So, it will be something like

//sysout dd dsn=abc.xyz,disp=(as per your choice)

Upvotes: 2

cschneid
cschneid

Reputation: 10765

Yes. You have to get the LRECL and RECFM correct, but you can get those from the source code to the program you're executing. Most standard reports are 133 and FB or 132 and FBA. I seem to remember IDCAMS was 121 and VBA.

//WNMPRAD5 EXEC PGM=WNMPRAD5,COND=(4,LT)                     
//SYSPRINT DD SYSOUT=1                                       
//SYSDBOUT DD SYSOUT=1                                       
//ENTRADA  DD DSN=WNMT.SCADUC.WGPT022.ZXDALMA.UNLDBI,DISP=OLD
//SORTIDA  DD DSN=WNMT.SCADUC.WGPT022.ZXDALMA.OUTPUT.V02,    
//            DISP=(NEW,CATLG,DELETE),UNIT=DISK,             
//            DCB=(RECFM=FB,LRECL=278),                      
//            SPACE=(27998,(2500,2500),RLSE) 
//SYSOUT   DD  DISP=(NEW,CATLG,DELETE),
//             DSN=&SYSUID..STEPNAME.SYSOUT,
//             AVGREC=K,
//             LRECL=133,
//             RECFM=FB,
//             SPACE=(500,(10,10))
//SYSIN    DD *                                              
N0100                                                        
/*

Upvotes: 2

Hogstrom
Hogstrom

Reputation: 3761

SYSOUT is no different than any other DD but is used by convention for output. You can create a DD like this in the STEP that creates the file:

//SYSOUT   DD DSN=MY.SYSOUT,    
//            DISP=(NEW,CATLG,DELETE),UNIT=DISK,             
//            DCB=(RECFM=FBA,LRECL=133,BLKSIZE=0),                      
//            SPACE=(27998,(2500,2500),RLSE)                 

The DCB will vary depending but 133 (assuming ASA character) is common. No need for a different step.

If you want, you could in a following step use IEBGENER to copy the Disk to another SYSOUT to store the contents in the JOB. Its not possible, as far as I know, to easily grab a SYSOUT in the next step and copy to disk.

Upvotes: 3

Related Questions