THE STRUCTURE OF JCL - IBM Mainframe

JCL is your way of telling the computer what programs you want to run, what datasets these programs will use what is the disposition of the datasets when the program execution ends, etc. Unlike the K.i the Mainframes are not designed to listen to your requests to execute programs one at a time. You use me TSO to talk to the system. TSO is a program executed by MVS to get your programs and JCL into machine mode. TSO is just a messenger to MVS and JCL is the only way you can talk to MVS. Programs are sequences of logical instructions. You write your programs in a high-level language like COBOL and then they are converted into machine code and are stored in datasets called a load module library or 'loadlib'. So to run a program you PARTITIONED DATASETS

Programs are the smallest units of processing logic that MVS deals with. You can consider the program as a black box. You give the necessary inputs to the program, the program does what it is instructed to do and gives you the output. What happens inside the box, depends on how and what you have coded the program. For example, lEBGENER is an IBM utility program, which is, installed your system. lEBGENER copies the contents of a dataset to another place. So there will be input and output datasets. lEBGENER has the following four datasets

  • :SYSUT1 - where lEBGENER expects to read the input dataset
  • SYSUT2 - where lEBGENER expects to write the data
  • SYSIN - where lEBGENER expects to read any special instructions
  • SYSPRINT - where lEBGENER expects to write a report telling what it did

These names are not inherent to JCL. They are symbolic identifiers used in this program. So from the JCL point of view lEBGENER is a black box. Its main job is to copy input from its SYSUT1 and output it at its SYSUT2. lEBGENER also expects to receive instructions from SYSIN and will write a status report at SYSPRINT.

JCL is a simple language. There are only eight JCL statements. They are:

eight JCL statements.

Note that all your JCLs for a job will start with the JOB statement. The JCL for every program you want to execute will begin with an EXEC statement indicating the program name. You will code separate DD statements to associate every input or output of the program to the actual dataset name.

Out of the 8 JCL statements, you will use the first 3 (JOB, EXEC and DD) statements very frequents and most tasks can be accomplished by these three statements:

8 JCL statements

Each of these statements has a name or a label immediately after the two slashes (//). You can for— the name using up to 8 uppercase characters or numbers, but the name should begin with a letter. Each kind of JCL statements has a different set of parameters.

JCL statements (except for special purpose /* delimiter statement) begin with // in columns 1 and 2. You have to code the statement type no further than to the right of column 16 or it will be treated as a comment. You can code same-line comments if you separate the comment from the last parameter on the line by at least one space. You can code a complete JCL statement only through column 71. Column 72 is used for indicating that the JCL statement is continuing to the next line. So be careful not to accidentally write something in column 72 unless you want to continue to the next line. Columns 73 -80 carry optional line numbers applied automatically by TSO/ISPF.

So a JCL statement can contain four parts. The fourth part is the comment part and is optional. This is shown below:

You can continue a statement to another line by breaking it at a comma and the lines that are continued can still carry comments.

If you make a logical mistake as opposed to a syntax error, in your JCL, MVS will not detect the problem until the job is executed. Misspelling the name of a dataset is a logical mistake, because only during execution that MVS will find out that no such dataset exist and will return an error message. Giving a program name, which does not exist in the EXEC statement, is another logical error. MVS conveys the information about the logical errors, through system completion code, which is a three-position value expressed in hexadecimal. Over 500 system completion codes exist. JCL log has also something called user return code or COND CODE which is a four position value in the range of 0000 through 4095 that is printed in the MVS system output for each step. The result of execution controls the value of the COND CODE. If a step process without abending you will get a COND CODE such as 0000 for the step but no system completion code. If you code a JCL with a logical error in the step or if the program at the step does something improper, you will get a system completion code such as 0C7 but not a COND CODE. A non-zero COND CODE doe not necessarily mean that a problem exists, but receiving a system completion code always indicates a problem.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

IBM Mainframe Topics