Tuesday, December 6, 2011

SDSF: Printing from SPOOL to dataset

Everyone should be familiar with the X, XD, or XDC commands used online to print SPOOL output onto a dataset.

Did you know how to do this in a batch program ?


Step 1 : Define the dataset to which you want to XDC, with (preferably) the following attributes :
RECFM=VBA, LRECL=133, BLKSIZE=27998, DSORG=PS

Step 2 :

//SDSF EXEC PGM=SDSF,PARM='++20,133'
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//ISFOUT DD SYSOUT=*
//ISFIN DD *
OWNER id*
PRE prefix*
ST
FIND 'this job'
++?
FIND 'JESMSGLG'
++S
PRINT ODSN 'pre defined dsn'
PRINT 1 9999
PRINT CLOSE
END
EXIT 

-----------------------------------------
1. To change screen width and depth of the batch output, use PARM='++xxxx,yyyy', following the program name, where xxxx is the depth of the screen (number of lines) and yyyy is the width (number of characters). For example, to set the depth to 32 and the width to 1000, use: 

     //SDSF   EXEC PGM=SDSF,PARM='++32,1000'
     //ISFOUT DD SYSOUT=*
     //ISFIN  DD * 

Note that PARM is optional. If you do not use the PARM statement, the width defaults to 132 and the depth to 60. The maximum for width and depth is 9999. 

2. The ++ corresponds to the TABS you enter when doing the same Online.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.