Create a Spool file with customized file name and OUTPUT values.
search cancel

Create a Spool file with customized file name and OUTPUT values.

book

Article ID: 37959

calendar_today

Updated On:

Products

Spool

Issue/Introduction

How to create a file in Spool with a customized file name and OUTPUT values?
When running the z/OS IEBGENER utility, the OUTPUT specifications are passed to Spool, but  the file name cannot be changed:

//MYJOB    JOB (12345),CLASS=A,MSGCLASS=X
//STEP1     EXEC PGM=IEBGENER                                      
//OUTPUT   OUTPUT COPIES=1,DEST=FOLLOWME,                         
//         USERLIB=(USER2.FONT300,                           
//         USER2.FDEFLIB,USER2.PDEFLIB)                
//SYSUT1   DD DSN=REPORT.FILE,DISP=SHR 
//SYSUT2    DD SYSOUT=(C,,STD),OUTPUT=*.OUTPUT                     
//SYSPRINT DD SYSOUT=*                                            
//SYSIN      DD DUMMY        

With the Spool ESFPRINT utility, an OWNER can be specified which allows for setting the file name as needed, but the OUTPUT statement is then ignored:

//MYJOB    JOB (12345),CLASS=A,MSGCLASS=X                                           
//STEP1 EXEC PGM=ESFPRINT,                                          
// PARM='DDNAME(SYSUT1) DEST(FOLLOWME) PRMODE(PAGE) OWN(MYFILE)'    
//STEPLIB  DD DISP=SHR,DSN=CAI.CBQ4LOAD
//OUTPUT   OUTPUT DEFAULT=YES,COPIES=1,DEST=FOLLOWME,                         
//         USERLIB=(USER2.FONT300,                           
//         USER2.FDEFLIB,USER2.PDEFLIB)                
//SYSUT1    DD DSN=REPORT.FILE,DISP=SHR 

Resolution

The following sample z/OS JCL uses the IEBGENER utility and uses the SUBSYS interface: 

//MYJOB     JOB (12345),CLASS=A,MSGCLASS=X                                           
//STEP1      EXEC PGM=IEBGENER                                      
//OUTPUT   OUTPUT COPIES=1,DEST=FOLLOWME,                         
//         USERLIB=(USER2.FONT300,                           
//         USER2.FDEFLIB,USER2.PDEFLIB)                
//SYSUT1    DD DSN=REPORT.FILE,DISP=SHR 
//SYSUT2    DD SUBSYS=(ESFX,C,MYFILE),OUTPUT=*.OUTPUT
//SYSPRINT DD SYSOUT=* 
//SYSIN DD DUMMY 
 
The SUBSYS= JCL statement refers to the SUBID for Spool (ESFX in the sample) and the MYFILE keyword will be used for the file name. 

When using this sample file MYFILE will be created in Spool with the attributes as defined with the OUTPUT statement.

Refer to the Spool System Guide , Chapter 8: SUBSYS Interface, item DD Statement SUBSYS Parameter for a list of the sub-parameters that can be specified while creating a Spool file.