Structure of JCL Statements
JCL Statement Structure:
- JCL statements are coded in 80 bytes.
- 72 of the 80 columns are available to code JCL.
- Last 8 columns are reserved for an optional sequence number.
- Each JCL statement is divided into several fields.
Syntax or Format:
Let's us see each field in detail,
1. Identifier Field:
- The identifier field identifies a record as a JCL statement.
- For most JCL statements, the identifier field occupies the first two character positions and must contain two slashes (//). There are two exceptions.
- First, the delimiter statement has a slash in column 1 and an asterisk in column 2 (/*).
- Second, the identifier field for a comment statement is three characters long: The first two columns contain slashes and the third contains an asterisk (//*).
2. Name Field:
It follows identifier field. The name field associates a name with a JCL statement.
- It is not mandatory everywhere; but it is always required on a JOB statement, where it supplies a name for a job.
- A name field must begin in column 3, right after the identifier field.
- It consists of one to eight characters, which may be letters, numbers or national characters (#, @, and $) Also, the first character of a name should be a letter or a national character.
Name field - Incorrect values:
Here the Name field is of length 9 characters hence we get this error:
Note here the Name field begins with a numeric value. Hence we get this error.
3. Operation Field:
The operation field follows the name field and it specifies the statements function.
- JOB, EXEC, and DD are the different operation fields.
- This field can be coded anywhere in the JCL, but it should be separated from the name field by at least one blank.
- However, conventionally, the operation field should be started in column 12.
4. Parameters Field:
The parameters field begins at least one position after the end of the operation field and can extend into column 71:
- Within the parameters field, we have to code one or more parameters that supply information that influences how the statement is processed.
- When a parameters field consists of more than one parameter, the individual parameters should be separated with commas.
- MVS assumes that the parameters field is complete when it encounters a space so do not include a space by accident. If you need to include a space as part of a parameter value, the parameter value must be enclosed in apostrophes.
There are two types of parameters:
We will be discussing about each parameters in next chapter.
5. Comments Field:
Following the parameters field, you can code brief comments in the comments field.
- The comments field begins in the position after the space that marks the end of the parameters field and ends in column 71.
- MVS ignores what is coded here, so you can record any comments you wish.
- You can also use an entire line as a comment.
- For this, you need to code //* starting from column one of the JCL record.
How to continue JCL statements?
When it is not possible to fit all the parameters on a single 80-character line, the statement can be continued onto one or more additional lines by following the below steps:
- Break the parameter field after the comma that follows a parameter or sub-parameter.
- Code slashes in columns 1 and 2 of the following line.
- Code the next parameter beginning anywhere in columns 4 through 16.
Video Tutorial: JCL Statement Structure
If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!