MSGLEVEL Parameter

Purpose

The MSGLEVEL parameter in JCL controls the amount of information included in the job output. It determines whether JCL statements and allocation/deallocation messages are included in the job log, and it specifies which job and step termination messages are generated.

Syntax

jcl
1
//jobname JOB (accounting-information),programmer-name,MSGLEVEL=(statements,messages)

Format

The MSGLEVEL parameter consists of two sub-parameters:

  1. statements - Controls JCL and allocation message printing:
    • 0 = No JCL statements printed, only JCL errors
    • 1 = JCL statements, allocation messages, and JCL errors printed (default)
    • 2 = Only JCL statements and JCL errors printed (no allocation messages)
  2. messages - Controls which system and job messages are printed:
    • 0 = Only job termination messages printed
    • 1 = Both job and step termination messages printed (default)

Examples

Basic Usage

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

Shows JCL statements, allocation messages, job and step termination messages (default)

Minimum Messages

jcl
1
//REPORT JOB (ACCT456),'JANE DOE',MSGLEVEL=(0,0)

Only shows JCL errors and job termination messages (minimal output)

JCL Only, No Allocation Messages

jcl
1
//COMPILE JOB (ACCT789),'DEVELOPER',MSGLEVEL=(2,1)

Shows JCL statements, no allocation messages, but includes job and step termination messages

Shorthand Format

jcl
1
//DEVEL JOB (ACCT321),'TEST USER',MSGLEVEL=1

Specifying only the first subparameter (1) uses default (1) for the second subparameter

Common MSGLEVEL Settings

MSGLEVELDescriptionUsage
(1,1)All information (default)Development, troubleshooting, debugging
(0,1)No JCL, but all messagesProduction jobs where JCL is already verified
(0,0)Minimal outputProduction jobs with minimal logging needs
(2,1)JCL only, no allocation messagesWhen you need JCL echo but not allocation details

Message Types Controlled

  • JCL Echo - The JCL statements as read by the system
  • Allocation Messages - Information about data set allocation and disposition
  • Step Termination Messages - Return codes, CPU time used, etc. for each step
  • Job Termination Messages - Overall job statistics and results
  • JCL Errors - Syntax and semantic errors in JCL (always shown)

Practical Applications

  • Development: Use MSGLEVEL=(1,1) for detailed debugging
  • Testing: Use MSGLEVEL=(1,1) to validate JCL execution
  • Production: Use MSGLEVEL=(0,0) or (0,1) to reduce unnecessary output
  • Diagnostics: Switch to MSGLEVEL=(1,1) when troubleshooting production issues

Notes

  • MSGLEVEL is optional - if omitted, defaults to MSGLEVEL=(1,1)
  • The first subparameter (statements) can be 0, 1, or 2
  • The second subparameter (messages) can be 0 or 1
  • If only one value is specified, it refers to the statements level parameter
  • JCL errors are always shown regardless of MSGLEVEL settings
  • MSGLEVEL affects the size of job output - higher levels generate more output
  • For large jobs with many steps, consider MSGLEVEL=(0,1) to reduce output volume
  • Some installations may enforce specific MSGLEVEL values for production jobs

Common Mistakes

  • Using MSGLEVEL=(0,0) during development and missing important diagnostics
  • Using MSGLEVEL=(1,1) for production jobs and generating excessive output
  • Confusing MSGLEVEL with MSGCLASS (different parameters with different purposes)
  • Failing to adjust MSGLEVEL appropriately when troubleshooting issues
  • Not considering the impact of MSGLEVEL on spool space usage for large jobs

Related Concepts

Related Pages