MSGCLASS Parameter

Purpose

The MSGCLASS parameter in JCL specifies the output class for job log messages, including JCL statements, allocation messages, JOB and step termination messages, and system messages. It determines where job output is directed and how it is handled by the system.

Syntax

jcl
1
//jobname JOB (accounting-information),programmer-name,MSGCLASS=class

Format

  • MSGCLASS is a keyword parameter on the JOB statement
  • class: A single alphanumeric character (A-Z, 0-9) or special character ($, #, @)
  • Installation-defined meaning for each MSGCLASS value
  • Default MSGCLASS is installation-defined, often 'A'

Examples

Basic Usage

jcl
1
//PAYROLL JOB (ACCT123),'JOHN SMITH',MSGCLASS=A

Routes the job output to output class A

With Multiple Parameters

jcl
1
2
//REPORT JOB (ACCT456),'JANE DOE', // CLASS=B,MSGCLASS=X,NOTIFY=USER01

Routes job messages to MSGCLASS X while running the job in CLASS B

SYSOUT Specification

jcl
1
2
//STEP1 EXEC PGM=IEBGENER //SYSOUT DD SYSOUT=*

SYSOUT=* uses the MSGCLASS value for SYSOUT data set output class

For TSO Review

jcl
1
//TSOJOB JOB (ACCT789),'TSO USER',MSGCLASS=H,NOTIFY=&SYSUID

Uses MSGCLASS H (typically for TSO viewing) and notifies the submitter when job completes

Common MSGCLASS Assignments

While these can vary by installation, common MSGCLASS assignments include:

MSGCLASSTypical Usage
APrinted output (routed to printer)
HHeld for TSO viewing (SDSF, IOF, etc.)
XHeld for TSO viewing, purged after certain time
ZHeld in spool, not automatically printed
JJES internal reader (for submitting jobs)
0Often used for SYSOUT purge (no output)

System Considerations

  • MSGCLASS values are defined in JES initialization parameters
  • JES2: OUTCLASS(x) statement defines output class attributes
  • JES3: SYSOUT statement defines output class attributes
  • Output classes typically have properties like:
    • Whether output is held or printed immediately
    • Retention period before purging
    • Default destination (printer, specific device)
    • Whether output is available for TSO viewing
    • External writer name if applicable
  • MSGCLASS applies to all unallocated SYSOUT data sets (SYSOUT=*) in the job

Relationship to JES

MSGCLASS interacts with JES (Job Entry Subsystem) output processing:

  • Controls how job output is queued in the JES spool
  • Affects output disposition (print, hold, purge)
  • Determines default destination for output
  • Controls whether output can be viewed via SDSF or other TSO interfaces
  • May influence output retention periods

Notes

  • MSGCLASS is optional - if omitted, the installation default is used
  • Impact on job output:
    • JES messages and job log
    • System messages related to the job
    • Allocation/deallocation messages
    • JCL listings
    • Any SYSOUT data sets using SYSOUT=*
  • MSGCLASS can be overridden for specific DD statements using SYSOUT=x parameter
  • OUTPUT statement can be used for more detailed output control
  • Some installations use automation to reroute output based on MSGCLASS
  • Using MSGCLASS=0 typically suppresses or purges output (installation-dependent)

Common Mistakes

  • Using a MSGCLASS that doesn't exist in the installation
  • Specifying a MSGCLASS that routes output to a printer when it should be held for viewing
  • Using MSGCLASS=0 and losing important diagnostic output
  • Failing to use an appropriate MSGCLASS for debugging purposes
  • Confusing MSGCLASS (job output) with CLASS (job execution queue)

Related Concepts

Related Pages