Taking control of job execution with specialized 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.
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:
1//jobname JOB accounting-info,programmer-name,TYPRUN=value
Common TYPRUN values:
SCAN
- JCL is checked for syntax errors but the job is not executedHOLD
- Job is held until released by an operator commandJCLHOLD
- JCL is checked, and if no errors are found, the job is heldCOPY
- Job is interpreted and written to SYSOUT, but not executedExample:
1234//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.
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:
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:
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).
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:
12//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 stepRESTART=(stepname,checkid)
- Restart from a checkpoint within the specified stepExample:
123456789//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 allow you to specify security credentials for job execution. These parameters include USER, PASSWORD, and GROUP.
Syntax:
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 jobPASSWORD
- Specifies the password associated with the user IDGROUP
- Specifies the security group associated with the jobExample:
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.
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:
1//jobname JOB accounting-info,programmer-name,NOTIFY=userid
Example:
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.
The ADDRSPC (address space) parameter specifies whether the job is to execute in a real or virtual storage environment.
Syntax:
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 storageExample:
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.
Let's look at some examples of jobs using multiple advanced parameters:
Example 1: Priority Production Job
123//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
12345//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
1234//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.
Advanced JOB parameters provide powerful capabilities for controlling job execution, priority, security, and notification. By understanding and using these parameters effectively, you can:
These parameters, when used appropriately, can significantly enhance the manageability and efficiency of your batch processing environment.
Create a JOB statement for each of the following scenarios: