The SYSOUT parameter directs output data to JES (Job Entry Subsystem) managed output devices or output classes. It allows you to route job output to printers, display terminals, other programs, or for storage in the JES spool. SYSOUT is the primary method for creating reports and other printed output in batch jobs.
1//ddname DD SYSOUT=class
1//ddname DD SYSOUT=(class,writer-name,form-name)
12//ddname DD SYSOUT=class, // OUTPUT=reference
1234//ddname DD SYSOUT=(class,writer-name,form-name), // DEST=destination, // COPIES=number, // DCB=(RECFM=record-format,LRECL=record-length,BLKSIZE=block-size)
The output class determines the processing characteristics of the output and its destination. Classes are single alphanumeric or national characters (A-Z, 0-9, @, #, $).
Common Classes | Typical Use |
---|---|
A | Standard printed output |
B | Output to be held for later viewing or printing |
X | Output to be purged immediately (often used for test jobs) |
Z | Held output with SYSOUT=* access for TSO users |
Note: Actual class assignments are installation-dependent and may vary. Check with your systems programmer for specific class assignments at your installation.
SYSOUT=(A,INTRDR)
- routes output to the internal readerSYSOUT=(A,,STD1)
- prints on form STD1DEST=R5
- sends to remote workstation 5DEST=NYC
- sends to the node named NYCDEST=USERID
- sends to a specific userDEST=NYC.USER1
- sends to USER1 at node NYCCOPIES=3
- prints three copiesOUTPUT=*.STEP1.OUT1
- references the OUT1 OUTPUT statement in STEP1OUTPUT=(*.OUT1,*.OUT2)
- references two OUTPUT statementsUses the MSGCLASS value from the JOB statement as the output class. This is useful for ensuring that all job output goes to the same class.
1//REPORT DD SYSOUT=*
A variation of SYSOUT=* that subtracts one from the MSGCLASS value. If MSGCLASS=A, this would be equivalent to SYSOUT=9. This is rarely used in modern JCL.
Used with SYSOUT to make output available for viewing or printing as soon as the DD statement is closed, rather than waiting for the job to complete.
1//EARLY DD SYSOUT=A,SPIN=UNALLOC
The DCB parameter can be used with SYSOUT to specify record format, record length, and block size. Common values for print files:
12//REPORT DD SYSOUT=A, // DCB=(RECFM=FBA,LRECL=133,BLKSIZE=6650)
1//REPORT DD SYSOUT=A
Directs output to class A, typically for printing
1//INVOICE DD SYSOUT=A,COPIES=3
Prints three copies of the output
1//CHECKS DD SYSOUT=(A,,CHECK)
Prints output on the CHECK form
1//AFP DD SYSOUT=(A,AFPDS)
Routes output to the AFPDS writer for Advanced Function Presentation printing
1//REMOTE DD SYSOUT=A,DEST=BRANCH5
Sends output to the BRANCH5 destination
1//HOLD DD SYSOUT=(H,,)
Sends output to class H, which is typically held for later processing
1234//STEP1 EXEC PGM=MYPROG //LAYOUT OUTPUT PAGEDEF=P1A4,FORMDEF=F1A4, // CHARS=GT12 //REPORT DD SYSOUT=A,OUTPUT=*.LAYOUT
Uses the LAYOUT OUTPUT statement to specify formatting parameters for the REPORT output
1//SUBJOB DD SYSOUT=(A,INTRDR)
Routes output to the internal reader, effectively submitting it as a new job
The SYSOUT parameter is an alternative to specifying a data set name (DSN). When SYSOUT is used, JES manages the output as a temporary spool data set. Compare these two approaches:
Using SYSOUT | Using DSN |
---|---|
jcl
| jcl
|
|
|