Mainframe: Reduce your Coding lines using OUTPUT statement in JCL (1 of 2)

JCL+DB2+Mainframe+JOBSTricky SYSOUT statement in JCL(Job control Language), and ignore it many times by programmers to understand it correctly.

Why SYSOUT is coded in JCL

  • SYSOUT data sets are output files that are designed to be printed rather than stored on DASD or tape.
  • how to print multiple copies of a data set without rerunning the entire job and how to send a data set to a printer in the department that needs the output.

Where to code SYSOUT in JCL

  1. The OUTPUT statement lets you specify many of the options for SYSOUT processing that you would otherwise code on a DD statement.
  2. The advantage of the OUTPUT statement is that the SYSOUT options can apply to multiple data sets in a job, so you don’t have to code the same parameters on each DD statement.
  3. You can reduce multiple lines of code by using OUTPUT statement

Syntax for OUTPUT

//name OUTPUT [ ,CLASS=class ]
              [ ,CONTROL= {PROGRAM} ]
               {SINGLE }
               {DOUBLE }
                {TRIPLE }
                [ ,COPIES= {nnn } ]
                [ ,DEFAULT= {YES} ]
                 {NO }
               [ ,DEST=destination ]
               [ ,FCB=fcb-name ]
               [ ,FLASH=overlay-name ]
               [ ,FORMS=form-name ]
            [ ,JESDS= {ALL} ]
           [ ,LINECT=nnn ]
            [ ,OUTDISP=(normal-disp[,abnormal-disp]) ]
            [ ,PRTY=nnn ]


CLASS-  Assigns an output class for SYSOUT data sets.
CONTROL- Specifies the line spacing for each record that’s printed.
COPIES- Specifies how many copies of the data set should be printed.
DEFAULT- Specifies whether or not this OUTPUT statement supplies default SYSOUT processing.
DEST- Specifies a destination for the SYSOUT data set.
FCB- Specifies the forms control buffer image to be downloaded to the printer when printing a special form.
FLASH- Specifies the name of the overlay to be used in printing a special form on a 3800 printing subsystem.
FORMS- Specifies the name of the form on which the SYSOUT data set is to be printed.
JESDS- Specifies the JES system data sets to which this OUTPUT statement applies.
LINECT- JES2 only; specifies the maximum number of lines to be printed on each page.
OUTDISP- JES2 only; specifies the disposition for a SYSOUT data set.
PRTY- Specifies a priority for the output data set.

Key points in OUTPUT statement:

  • The OUTPUT statement is used to set options that can apply to multiple SYSOUT data sets within a job.
  • An OUTPUT statement can be used to provide default options for all the SYSOUT data sets produced by a job or a job step. Or it can be used only for those data sets that explicitly reference it in their DD statements.

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.