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.
  • The system processes the output from DD statement MFK1 using the options on the OUTPUT statement OUT3 (1) because MFK1 does not contain an OUTPUT parameter and (2) because OUT3 contains DEFAULT=YES and is in the same step as MFK1. MFK1 cannot implicitly reference the job-level default statement OUT2 because of step-level default statement OUT3. If STEP1 had not contained OUT3, MFK1 would have referenced statement OUT2.
  • The system processes the output from DD statement MFK2 according to the processing options on the job-level OUTPUT JCL statement OUT1 because DD statement MFK2 explicitly references OUT1 using the OUTPUT parameter. Note that the system ignores the processing options on all default OUTPUT JCL statements (OUT2 and OUT3).
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
  • DEFAULT=YES is specified on OUTPUT JCL statements OUT1 and OUT2, and
  • there is no OUTPUT JCL statement with DEFAULT=YES within STEP1.
  • The OUTPUT parameter is not specified on DD statements R1 and R2.
In STEP2, the system processes DD statement B1 using the processing options specified on OUTPUT JCL statement OUT3 because:
  • DEFAULT=YES is specified on OUTPUT JCL statement OUT3 and OUTPUT JCL statement OUT3 is within the job step STEP2.
  • The OUTPUT parameter is not specified on DD statement B1.
  • OUTPUT JCL statement OUT3 is within STEP2; therefore, the system ignores the DEFAULT=YES specification on job-level OUTPUT JCL statements OUT1 and OUT2 when processing DD statement B1.
In STEP2, the system processes DD statement B2 using the processing options specified on OUTPUT JCL statements OUT3 and OUT2 because:
  • Both of the OUTPUT JCL statements are explicitly referenced from the SYSOUT statement. Explicitly-referenced OUTPUT JCL statements can be in any previous procedure or step, before the DD statement in the current step, or at the job-level.
  • Note that default OUTPUT JCL statement OUT1 is ignored when processing the data set defined by DD statement B2 because B2 explicitly references OUTPUT JCL statements OUT3 and OUT2.
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:
  • DEFAULT=YES is specified on OUTPUT JCL statements OUT1 and OUT2, and
  • no OUTPUT JCL statement with DEFAULT=YES is coded within STEP3.
  • The OUTPUT parameter is not specified on DD statement RP1.
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.