Introduction
The JOB statement is the first statement in a JCL job and is used to identify the job to the operating system. It provides essential information such as the job name, accounting information, and various job-level parameters.
Key Concepts
- Job Name: A unique identifier for the job.
- Accounting Information: Used for tracking resource usage.
- Job Parameters: Control job execution, such as priority and time limits.
Basic Structure
The basic syntax of a JOB statement is as follows:
Components
- JOBNAME: A unique name for the job, up to 8 characters.
- JOB: Keyword indicating the start of a job statement.
- (accounting_info): Optional, used for resource tracking.
- 'job_description': Optional, a brief description of the job.
- parameters: Optional, various parameters to control job execution.
Example
Here is a simple example of a JOB statement:
Explanation
- MYJOB01: The job name.
- (12345): Accounting information.
- 'Sample Job': A description of the job.
- CLASS=A: Specifies the job class.
- MSGCLASS=X: Specifies the output class for messages.
- MSGLEVEL=(1,1): Controls the level of messages produced.
Common Parameters
Here are some commonly used parameters in the JOB statement:
Parameter | Description |
---|---|
CLASS | Specifies the job class, which determines the job's priority and resources. |
MSGCLASS | Specifies the output class for job messages. |
MSGLEVEL | Controls the level of messages produced by the job. |
TIME | Specifies the maximum CPU time the job can use. |
REGION | Specifies the amount of memory allocated to the job. |
Practical Example
Let's create a more detailed JOB statement with additional parameters:
//FINANCE01 JOB (ACCT123), 'Finance Report', CLASS=B, MSGCLASS=H, MSGLEVEL=(2,0), // TIME=1440, REGION=4M
Explanation
- FINANCE01: The job name.
- (ACCT123): Accounting information.
- 'Finance Report': A description of the job.
- CLASS=B: Specifies the job class B.
- MSGCLASS=H: Specifies the output class H for job messages.
- MSGLEVEL=(2,0): Produces detailed messages.
- TIME=1440: Allows the job to run for up to 1440 minutes (24 hours).
- REGION=4M: Allocates 4 megabytes of memory to the job.
Practical Exercise
Create a JOB statement for a job named PAYROLL01
with the following requirements:
- Accounting information:
PAY123
- Description:
Payroll Processing
- Job class:
C
- Message class:
Y
- Message level:
(1,0)
- Maximum CPU time:
720
minutes - Memory allocation:
8M
Solution
//PAYROLL01 JOB (PAY123), 'Payroll Processing', CLASS=C, MSGCLASS=Y, MSGLEVEL=(1,0), // TIME=720, REGION=8M
Common Mistakes and Tips
- Job Name Uniqueness: Ensure the job name is unique within the system to avoid conflicts.
- Parameter Syntax: Double-check the syntax of parameters to avoid errors.
- Resource Limits: Be mindful of resource limits (TIME, REGION) to prevent job failures.
Conclusion
The JOB statement is a crucial part of JCL, providing essential information to the operating system about the job. Understanding its structure and parameters is fundamental for creating effective JCL jobs. In the next topic, we will explore the EXEC statement, which specifies the program or procedure to be executed by the job.
JCL (Job Control Language) Course
Module 1: Introduction to JCL
Module 2: JCL Statements and Syntax
Module 3: Data Definition (DD) Statements
Module 4: Procedures and Symbolic Parameters
Module 5: Advanced JCL Concepts
- Conditional Processing
- JCLLIB and INCLUDE Statements
- Generation Data Groups (GDGs)
- Restart and Checkpoint
Module 6: Error Handling and Debugging
- Common JCL Errors
- Interpreting JCL Error Messages
- Debugging Techniques
- Using JES2/JES3 for Troubleshooting