In this section, we will explore the various commands available in Control Language (CL) for managing jobs. Jobs are fundamental units of work in a system, and understanding how to manage them is crucial for efficient system administration.
Key Concepts
- Job: A job is a unit of work that the system performs. It can be a batch job, an interactive job, or a system job.
- Job Queue: A job queue is a queue where jobs wait to be processed.
- Job Description: A job description contains attributes that define how a job should be run.
- Subsystem: A subsystem is a single, predefined operating environment through which the system coordinates the work flow and resource usage.
Common Job Management Commands
- Submitting a Job (SBMJOB)
The SBMJOB command is used to submit a job to a job queue.
Syntax:
Example:
This command submits a job named MYJOB to the job queue QBATCH to call the program MYPGM.
- Displaying Job Status (WRKJOB)
The WRKJOB command is used to display the status of a job.
Syntax:
Example:
This command displays the status and details of the job named MYJOB.
- Ending a Job (ENDJOB)
The ENDJOB command is used to end a job.
Syntax:
Example:
This command ends the job named MYJOB immediately.
- Holding a Job (HLDJOB)
The HLDJOB command is used to hold a job, preventing it from running.
Syntax:
Example:
This command holds the job named MYJOB.
- Releasing a Job (RLSJOB)
The RLSJOB command is used to release a job that was previously held.
Syntax:
Example:
This command releases the job named MYJOB.
- Changing Job Attributes (CHGJOB)
The CHGJOB command is used to change the attributes of a job.
Syntax:
Example:
This command changes the run priority of the job named MYJOB to 20.
Practical Exercise
Exercise 1: Submitting and Managing a Job
- 
Submit a Job: Submit a job named TESTJOBto call a programTESTPGMin the job queueQGPL.SBMJOB CMD(CALL PGM(TESTPGM)) JOB(TESTJOB) JOBQ(QGPL)
- 
Display Job Status: Display the status of the job TESTJOB.WRKJOB JOB(TESTJOB)
- 
Hold the Job: Hold the job TESTJOB.HLDJOB JOB(TESTJOB)
- 
Release the Job: Release the job TESTJOB.RLSJOB JOB(TESTJOB)
- 
End the Job: End the job TESTJOBimmediately.ENDJOB JOB(TESTJOB) OPTION(*IMMED)
Solution
- 
Submit a Job: SBMJOB CMD(CALL PGM(TESTPGM)) JOB(TESTJOB) JOBQ(QGPL)
- 
Display Job Status: WRKJOB JOB(TESTJOB)
- 
Hold the Job: HLDJOB JOB(TESTJOB)
- 
Release the Job: RLSJOB JOB(TESTJOB)
- 
End the Job: ENDJOB JOB(TESTJOB) OPTION(*IMMED)
Common Mistakes and Tips
- Incorrect Job Name: Ensure the job name specified in the commands matches the actual job name.
- Job Queue Availability: Verify that the job queue specified is available and not full.
- Permissions: Ensure you have the necessary permissions to manage jobs.
Conclusion
In this section, we covered the essential commands for managing jobs in CL. You learned how to submit, display, hold, release, and end jobs. These commands are fundamental for effective job management and system administration. In the next section, we will explore system management commands to further enhance your control over the system.
CL (Control Language) Course
Module 1: Introduction to CL
- What is Control Language?
- Setting Up Your Environment
- Basic Syntax and Structure
- Writing Your First CL Program
Module 2: Basic CL Commands
- Introduction to CL Commands
- File Management Commands
- Job Management Commands
- System Management Commands
Module 3: Variables and Expressions
Module 4: Control Structures
Module 5: Advanced CL Commands
- Advanced File Operations
- Advanced Job Scheduling
- System Configuration Commands
- Security and Permissions
