Adding parameters from OUTPUT JCL statement

JES combines the parameters from the sysout DD statement and one OUTPUT JCL to write the sysout data set. If a parameter appears on both statements, JES uses the parameter from the DD statement.

Note that if an OUTPUT JCL statement contains both JESDS and CLASS parameters, this CLASS will override the MSGCLASS parameter on the JOB statement for the specified JES data sets.

Multiple references: A sysout DD statement can reference more than one OUTPUT JCL statement. For each reference to an OUTPUT JCL statement, JES processes the sysout data set using the parameters of the DD statement combined with the parameters from one of the OUTPUT JCL statements.

Example 1:
//JOB1    JOB      ,'DEPT. 25'
//OUT1    OUTPUT   COPIES=8,DEST=FRANCE
//OUT2    OUTPUT   COPIES=2,FORMS=A,DEFAULT=YES
//STEP1   EXEC     PGM=DEMENT
//OUT3    OUTPUT   DEFAULT=YES,COPIES=5,DEST=REMULAC
//INPUT   DD       DSN=RHINO
//MFK1    DD       SYSOUT=A
//MFK2    DD       SYSOUT=B,OUTPUT=*.OUT1  
This example shows an explicit reference to an OUTPUT JCL statement. Note that with an explicit reference, all default OUTPUT JCL statements are ignored.
Example 2:
//EXAMP  JOB     MSGCLASS=A
//OUT1   OUTPUT  DEFAULT=YES,DEST=COMPLEX7,FORMS=BILLING,
//           CHARS=(AOA,AOB),COPIES=2
//OUT2   OUTPUT  DEFAULT=YES,DEST=COMPLEX1
//STEP1  EXEC    PGM=ORDERS
//R1     DD      SYSOUT=A
//R2     DD      SYSOUT=A
//STEP2  EXEC    PGM=BILLING
//OUT3   OUTPUT  DEFAULT=YES,DEST=COMPLEX3
//B1     DD      SYSOUT=A
//B2     DD      SYSOUT=A,OUTPUT=(*.OUT3,*.OUT2)
//STEP3  EXEC    PGM=REPORTS
//OUT4   OUTPUT  FORMS=SHORT,DEST=COMPLEX1
//RP1    DD      SYSOUT=A
//RP2    DD      SYSOUT=A,OUTPUT=(*.STEP2.OUT3,*.OUT1)
//  

This example shows how the position of the OUTPUT JCL statement affects the processing of the sysout data sets.

In STEP1, the system processes DD statements R1 and R2 using the processing options specified on job-level OUTPUT JCL statements OUT1 and OUT2 because
In STEP2, the system processes DD statement B1 using the processing options specified on OUTPUT JCL statement OUT3 because:
In STEP2, the system processes DD statement B2 using the processing options specified on OUTPUT JCL statements OUT3 and OUT2 because:
In STEP3, the system processes DD statement RP1 using the output processing options specified on the job-level OUTPUT JCL statements OUT1 and OUT2 because:
Note: In STEP3, OUTPUT JCL statement OUT4 is not used at all because it does not have DEFAULT=YES coded, and no DD statement explicitly references OUT4.

In STEP3, DD statement RP2 is processed using OUTPUT statements OUT3 and OUT1. You can explicitly reference an OUTPUT JCL statement in another step if you use a fully qualified reference, such as the reference to OUTPUT statement OUT3 used on DD statement RP2.

You may explicitly reference an OUTPUT JCL statement with DEFAULT=YES coded, such as the reference to OUT1 from DD statement RP2. The system ignores the DEFAULT parameter and uses the remaining processing options according to the normal rules that apply when coding explicit references.

Example 3:
//STEP1  EXEC   PGM=MFK
//OUT1   OUTPUT COPIES=6,DEST=NY,FORMS=BILLS
//OUT2   OUTPUT COPIES=2,DEST=KY,FORMS=LOG
//REF1   DD     SYSOUT=A,OUTPUT=(*.OUT1,*.OUT2)  

In the example, two sets of output are created from DD statement REF1. One of the sets will go to NY and have six copies printed on the form defined as BILLS. The other set will go to KY and have two copies printed on the form defined as LOG.