MainframeMaster

JCL Tutorial

JOB Statement Basics

Progress0 of 0 lessons

JOB Statement Format

The JOB statement is the first statement in a JCL job and identifies the beginning of a job. It provides the system with essential information about the job's identity, resource requirements, and processing characteristics.

Basic JOB Statement Format

jcl
1
//jobname JOB (accounting-info),'programmer-name',parameter-list

The JOB statement consists of several parts, most of which can be customized based on installation requirements and job needs.

JOB Statement Fields

1. Identifier Field (columns 1-2)

  • Must contain // for all JCL statements

2. Name Field (columns 3-10)

  • Contains the jobname (1-8 characters)
  • First character must be alphabetic (A-Z) or national (@, #, $)
  • Remaining characters can be alphanumeric (A-Z, 0-9) or national
  • Must be unique among active jobs in the system

3. Operation Field (column 12+)

  • Contains JOB to identify this as a JOB statement

4. Operand Field

  • Accounting information (installation-specific format)
  • Programmer name (typically enclosed in single quotes)
  • Various job-level parameters separated by commas

JOB Naming Rules

The jobname is a critical identifier for your job and follows specific naming conventions.

Jobname Requirements

  • Must be 1-8 characters long
  • First character must be A-Z, @, #, or $
  • Remaining characters can be A-Z, 0-9, @, #, or $
  • Must be unique among all active jobs in the system
  • Cannot contain spaces or special characters other than @, #, $
  • Some installations may have specific naming conventions

Valid Jobname Examples

//PAYROLL
//TEST01
//$BACKUP
//ABC123
//@REPORT
//#SYSTEM

Invalid Jobname Examples

//123TEST (starts with a number)
//JOB-NAME (contains hyphen)
//PAY ROLL (contains space)
//TOOLONGNAME (exceeds 8 chars)

Some installations implement naming standards that encode information in the jobname, such as application identifier, environment, or job type. Always follow your installation's naming conventions.

Accounting Information Field

The accounting information field in the JOB statement provides billing and resource tracking information. Its format is installation-dependent and may be required in some environments.

Accounting Information Format

The accounting information is enclosed in parentheses and may contain multiple subparameters separated by commas:

jcl
1
//MYJOB JOB (account,department,room,etc),...

Some installations use a simple account number, while others may require more detailed information:

jcl
1
//MYJOB JOB (D58192),...
jcl
1
//MYJOB JOB (D58192,DEPT123),...
jcl
1
//MYJOB JOB (D58192,DEPT123,'ROOM 101'),...

Special Considerations

  • If accounting information contains special characters or spaces, it must be enclosed in apostrophes
  • To include an apostrophe within quoted text, use two consecutive apostrophes
  • If accounting information is not required, you can specify empty parentheses: ()
  • Some installations may have automated account validation

The accounting information is used for billing purposes, resource tracking, and access control. Consult your installation's standards for the specific format required.

Programmer Name Field

The programmer name field identifies the person responsible for the job. It typically appears after the accounting information.

Programmer Name Format

The programmer name is enclosed in apostrophes and can be up to 20 characters long:

jcl
1
//MYJOB JOB (account),'JOHN SMITH',...

The programmer name appears on job output headers and can be used to route output to specific locations.

Common Naming Practices

  • Full name: 'JOHN SMITH'
  • User ID: 'JSMITH'
  • Department or function: 'PAYROLL DEPT'
  • Application name: 'INVENTORY SYSTEM'
  • Symbolic parameter: '&SYSUID'

Using a symbolic parameter like &SYSUID is common to automatically include the submitter's user ID.

The programmer name is primarily used for identification purposes. In production environments, it often identifies the owning application or department rather than an individual programmer.

Basic JOB Statement Examples

Below are examples of JOB statements with varying levels of complexity.

Simple JOB Statement

jcl
1
//MYJOB JOB (A123),'JOHN SMITH'

This basic JOB statement includes only the required elements - jobname, accounting information, and programmer name. All other parameters use installation defaults.

JOB Statement with Common Parameters

jcl
1
2
//PAYROLL JOB (A123),'JOHN SMITH',CLASS=A, // MSGCLASS=X,NOTIFY=&SYSUID

This example includes CLASS and MSGCLASS to control execution class and output routing, and NOTIFY to send completion messages to the submitter.

Comprehensive JOB Statement

jcl
1
2
3
4
//PAYROLL JOB (A123,DEPT123,'ROOM 101'),'JOHN SMITH', // CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID, // MSGLEVEL=(1,1),REGION=0M,TIME=NOLIMIT, // TYPRUN=SCAN,USER=PAYUSR01,PASSWORD=XXXXXXXX

This comprehensive example includes detailed accounting information, execution parameters, resource specifications, and security credentials. The TYPRUN=SCAN parameter indicates this job will be checked for syntax errors only, without actual execution.

Site-Specific JOB Statement

jcl
1
2
3
4
5
6
7
//*--------------------------------------------------* //* STANDARD SITE JOB CARD FOR PRODUCTION PAYROLL * //*--------------------------------------------------* //PAYPR01 JOB (PAY123),'PAYROLL PRODUCTION', // CLASS=P,MSGCLASS=X,NOTIFY=&SYSUID, // MSGLEVEL=(1,1),REGION=8M,TIME=1440, // RESTART=STEP040,TYPRUN=HOLD

This example shows a production job with site-specific conventions, including descriptive comments, a standardized jobname, and parameters tailored for a production payroll job.

JOB Statement Best Practices

Following these best practices will help create robust and maintainable JOB statements.

Naming Conventions

  • Use descriptive jobnames that identify the purpose
  • Follow site standards for naming conventions
  • Use a consistent naming scheme across related jobs
  • Consider incorporating application identifier

Parameter Selection

  • Explicitly specify important parameters
  • Don't rely on installation defaults for critical values
  • Use appropriate CLASS values for job type
  • Set reasonable TIME and REGION limits

Documentation

  • Add descriptive comments before the JOB statement
  • Include purpose, schedule, and contact information
  • Document any unusual parameters or requirements
  • Use consistent comment formatting

Security Considerations

  • Never include plaintext passwords in JCL
  • Use security system features rather than JCL parameters
  • Restrict access to JCL containing sensitive information
  • Consider using RACF or equivalent for access control