MainframeMaster

JCL Tutorial

Advanced JOB Parameters

Taking control of job execution with specialized parameters

Progress0 of 0 lessons

Introduction to Advanced JOB Parameters

Beyond the basic JOB statement parameters, there are several advanced parameters that give you greater control over how your jobs execute. These parameters allow you to handle specialized execution needs, control job priority, implement recovery mechanisms, and address security requirements.

TYPRUN Parameter

The TYPRUN parameter controls the type of job execution. It can be used to scan a job for JCL errors without actually executing it, or to hold a job until it is released.

Syntax:

jcl
1
//jobname JOB accounting-info,programmer-name,TYPRUN=value

Common TYPRUN values:

  • SCAN - JCL is checked for syntax errors but the job is not executed
  • HOLD - Job is held until released by an operator command
  • JCLHOLD - JCL is checked, and if no errors are found, the job is held
  • COPY - Job is interpreted and written to SYSOUT, but not executed

Example:

jcl
1
2
3
4
//TESTJOB JOB (ACCT123),'JOHN SMITH',TYPRUN=SCAN //STEP1 EXEC PGM=IEFBR14 //DD1 DD DSN=TEST.DATA.SET,DISP=(NEW,CATLG,DELETE), // SPACE=(TRK,(10,5)),DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)

This example will only check the JCL for errors without actually executing the job. This is useful during development to ensure your JCL is syntactically correct.

PRTY Parameter

The PRTY (priority) parameter specifies the execution priority of the job within its job class. Jobs with higher priority values are selected for execution before jobs with lower priority values.

Syntax:

jcl
1
//jobname JOB accounting-info,programmer-name,PRTY=priority

The priority is a numeric value from 0 to 15, with 15 being the highest priority. If omitted, the default priority is installation-defined.

Example:

jcl
1
//HPRIORTY JOB (ACCT123),'JOHN SMITH',CLASS=A,PRTY=12

This job will have a higher execution priority (12) within its assigned class (A).

Note:

The actual priority range and behavior may vary by installation. Some systems may use 0-15, while others might use a different range or even reverse the scale (where 0 is highest priority).

RESTART Parameter

The RESTART parameter allows you to restart a job from a specific step, bypassing steps that have already completed successfully. This is particularly useful for long-running jobs that fail after completing several steps.

Syntax:

jcl
1
2
//jobname JOB accounting-info,programmer-name,RESTART=stepname //jobname JOB accounting-info,programmer-name,RESTART=(stepname,checkid)

There are two forms of the RESTART parameter:

  • RESTART=stepname - Restart execution at the specified step
  • RESTART=(stepname,checkid) - Restart from a checkpoint within the specified step

Example:

jcl
1
2
3
4
5
6
7
8
9
//RESTJOB JOB (ACCT123),'JOHN SMITH',RESTART=STEP3 //STEP1 EXEC PGM=PROG1 //... //STEP2 EXEC PGM=PROG2 //... //STEP3 EXEC PGM=PROG3 //... //STEP4 EXEC PGM=PROG4 //...

In this example, the job will begin execution at STEP3, skipping STEP1 and STEP2 which are assumed to have completed successfully in a previous run.

Security Parameters

Security parameters allow you to specify security credentials for job execution. These parameters include USER, PASSWORD, and GROUP.

Syntax:

jcl
1
//jobname JOB accounting-info,programmer-name,USER=userid,PASSWORD=password,GROUP=groupid

These parameters are used as follows:

  • USER - Specifies the user ID associated with the job
  • PASSWORD - Specifies the password associated with the user ID
  • GROUP - Specifies the security group associated with the job

Example:

jcl
1
//SECJOB JOB (ACCT123),'JOHN SMITH',USER=JSMITH,GROUP=FINANCE

Security Note:

In modern systems, including PASSWORD parameters in JCL is not recommended for security reasons. Most installations use external security managers like RACF, ACF2, or Top Secret to handle authentication without embedding passwords in JCL.

NOTIFY Parameter

The NOTIFY parameter specifies the user ID to be notified when the job completes. This allows users to receive notifications about job completion without having to continuously check job status.

Syntax:

jcl
1
//jobname JOB accounting-info,programmer-name,NOTIFY=userid

Example:

jcl
1
//NOTJOB JOB (ACCT123),'JOHN SMITH',NOTIFY=JSMITH

When this job completes (either successfully or with an error), a notification will be sent to user JSMITH.

Note:

The notification is sent to the specified user's TSO terminal if they are logged on. If the user is not logged on, a message is queued to be displayed at their next logon.

ADDRSPC Parameter

The ADDRSPC (address space) parameter specifies whether the job is to execute in a real or virtual storage environment.

Syntax:

jcl
1
//jobname JOB accounting-info,programmer-name,ADDRSPC=value

Possible values for ADDRSPC:

  • VIRT (or V) - Job uses virtual storage (default)
  • REAL (or R) - Job uses real storage

Example:

jcl
1
//REALJOB JOB (ACCT123),'JOHN SMITH',ADDRSPC=REAL

Modern Usage Note:

In modern z/OS environments, virtually all jobs run with ADDRSPC=VIRT. The REAL option is rarely used and may require special authorization.

Real-World Job Configuration Examples

Let's look at some examples of jobs using multiple advanced parameters:

Example 1: Priority Production Job

jcl
1
2
3
//PRODJOB JOB (ACCT123),'PRODUCTION RUN', // CLASS=P,PRTY=14,NOTIFY=SYSADM, // MSGCLASS=X,MSGLEVEL=(1,1)

This high-priority production job runs in class P with a priority of 14. The system administrator (SYSADM) will be notified when the job completes.

Example 2: Job with Restart Capability

jcl
1
2
3
4
5
//LONGRUN JOB (ACCT123),'MONTHLY PROCESS', // CLASS=A,TIME=NOLIMIT, // RESTART=STEP004, // NOTIFY=OPERATOR, // REGION=0M

This job restarts at STEP004, has no time limit, and will notify the operator when complete. It requests unlimited region size.

Example 3: Security-Conscious Job

jcl
1
2
3
4
//SECPROC JOB (ACCT123,SEC5),'SECURE PROCESS', // USER=SECADMIN,GROUP=SECGRP, // CLASS=S,MSGCLASS=A, // TYPRUN=HOLD

This job runs under the SECADMIN user ID in the SECGRP security group. It's held after submission (TYPRUN=HOLD) until an operator releases it.

Best Practices for Advanced JOB Parameters

  • Use TYPRUN=SCAN during development to check for JCL errors without executing the job
  • Only use high PRTY values for truly urgent jobs
  • Design jobs with restart capabilities for long-running processes
  • Use NOTIFY for jobs that require human attention upon completion
  • Follow your organization's security guidelines for USER and GROUP parameters
  • Document your use of advanced parameters in job documentation for easier maintenance

Summary

Advanced JOB parameters provide powerful capabilities for controlling job execution, priority, security, and notification. By understanding and using these parameters effectively, you can:

  • Test JCL without executing jobs using TYPRUN
  • Control job priority with PRTY
  • Implement job recovery with RESTART
  • Maintain security with USER, PASSWORD, and GROUP
  • Get notifications about job completion with NOTIFY
  • Control storage usage with ADDRSPC

These parameters, when used appropriately, can significantly enhance the manageability and efficiency of your batch processing environment.

Practice Exercise

Create a JOB statement for each of the following scenarios:

  1. A job that needs to be checked for JCL errors but not executed
  2. A high-priority job that needs to run as user ADMIN in the SYSPROG group
  3. A job that should restart at step STEP3 and notify user DEVLEAD when complete