The main operating system for IBM Mainframe systems, Multiple Virtual Storage (MVS), uses Job Control Language (JCL) as its command language. JCL notifies the Operating System using Job control Statements about the program to be performed, the inputs needed, and the input and output location. Programs can be run in batch mode or online mode on a mainframe. JCL is used to submit a program for batch mode execution.
When to Use JCL
In a mainframe setting, JCL is utilized to provide a communication channel between an application (for instance, COBOL, Assembler, or PL/I) and the operating system. Programs can be run in batch mode or online mode on a mainframe. A VSAM (Virtual Storage Access Method) file used to process bank transactions and apply them to the appropriate accounts is an example of a batch system. A back office screen used by bank employees to open an account is an example of an online system. Programs are sent to the operating system as a job in batch mode using a JCL.
Processing Jobs
- A job is a type of work that may be broken down into numerous job tasks. A collection of Work Control Statements in a Job Control Language (JCL) are used to specify each job phase.
- The Job Entry System (JES) is a tool that the operating system utilizes to receive jobs, schedule them for processing, and manage output.
The steps involved in processing a job are as follows:
- Job Submission: Sending JES the JCL.
- Job Conversion: The JCL and PROC are combined to create an interpreted text that JES can understand and are then saved in a dataset that we refer to as SPOOL
- Job Queuing: Using the CLASS and PRTY parameters in the JOB statement, JES determines the job’s priority (explained in JCL – JOB Statement chapter). If there are no JCL issues, the job is reviewed to see if it may be scheduled into the job queue.
- Job Execution: A job is selected from the job queue for execution when it reaches the highest priority. The program is run, the JCL is read from the SPOOL, and the output is then directed to the appropriate output destination as stated in the JCL.
- SPOOL: When a work is finished, the JES SPOOL space and the allotted resources are freed. Before it is released from the SPOOL, the job log must be copied to another dataset for storage.
JCL Execution on MainFrames
Several methods exist for users to connect to a mainframe server, including thin clients, fake terminals, virtual client systems (VCS), and virtual desktop systems (VDS).
When accessing the TSO/E or ISPF interface on Z/OS, every legitimate user is given a login ID. The JCL can be programmed and stored as a member in a partitioned dataset in the Z/OS interface (PDS). The JCL is performed when it is sent and the output is received.
Structure of a JCL
The basic form of a JCL with the joint statements, is given below
//SAMPJCL JOB 1, CLASS=6, MSGCLASS=0, NOTIFY=&SYSUID (1)
//* (2)
//STEP010 EXEC PGM=SORT (3)
//SORTIN DD DSN=JCL.SAMPLE.INPUT,DISP=SHR (4)
//SORTOUT DD DSN=JCL.SAMPLE.OUTPUT, (5)
// DISP=(NEW,CATLG,CATLG),DATACLAS=DSIZE50
//SYSOUT DD SYSOUT=* (6)
//SYSUDUMP DD SYSOUT=C (6)
//SYSPRINT DD SYSOUT=* (6)
//SYSIN DD * (6)
SORT FIELDS=COPY
INCLUDE COND=(28,3, CH, EQ, C'XXX')
/* (7)
Program Summary
The following explains each of the numbered JCL statements
- JOB statement—Specifies the data needed for SPOOLing the job, such as the job id, the priority of execution, and the user-id that will be alerted when the job is finished.
- //* statement – This statement serves as commentary.
- The PROC or program to be run is specified in the EXEC statement. In the illustration mentioned earlier, a SORT program is running (i.e., sorting the input data in a particular order)
- The input DD statement specifies the kind of input that will be provided to the application in (3). A Physical Sequential (PS) file is supplied as input in the example above in shared mode (DISP = SHR).
- The output DD statement specifies the output generated when the application is run. An example of a PS file is constructed above. A statement is continued in the following line, which should begin with “//” and one or more spaces if it continues past the 70th position in a bar.
- Extra DD statement types can be used to provide the program with additional information (in the example above, the SYSIN DD statement specifies the SORT condition) and to indicate the location of the error/execution log (example: SYSUDUMP/SYSPRINT). As shown in the example above, DD statements can be found in a dataset (mainframe file) or as stream data (information hard-coded within the JCL).
The in-stream data ends at (7) /*.
Except for stream data, every JCL statement begins with /. Before and after the JOB, EXEC, and DD keywords, there should be at least one space and no spaces in the remaining portion of the statement.
Leave a Reply