Module 2: JCL Structure and Job Card
Fields of JCL statements
There are five common fields in all JCL statements:-
- Identifier (ID) Field
- Name Field
- Operation Field
- Operand Field
- Comments Field (optional)
The JCL Statement- Parts of a whole
Identifier (ID) field:-
It is first field in any JCL statement. It usually occupies column 1 and 2 as shown in above image. In the ID position:-
- Regular JCL statement has //
- Delimiter statement has /*
- Comment statement has //* (3 positions)
- Regular data has no special characters
Name field:-
This filed begins in column 3 i.e. 3rd position of JCL statements. We can specify maximum 8 characters in this field and it can be alphanumeric or may contain national characters ($, #, @), however first position can be coded with numeric character. This field is optional other than for Job statement
Operation field:-
This field is used to define function of statement. It can be JOB, EXEC or DD. Delimiter and comment statements don’t have operation field coded. While coding operation field make sure to put at least one preceding and at least one succeeding blank
Operand filed:-
This filed contains all operation field parameters. There is no maximum character restriction on this field. There should not be any spaces within this filed. If operand field is longer than one line then comma can be used as continuation character. There are two kinds of parameters coded in this field and they are Positional and Keyword parameters. Keyword parameters can be coded only after positional parameters.
- Positional parameters:- As name suggests Positional parameters has fixed position, which means you cannot specify them in any order of your choice. If you do not wish to specify them then must replace by comma ‘,’ to indicate system that it has been omitted. Example accounting information and programmer name on JOB statement.
- Keyword parameters:- Keyword parameter must always follow positional parameters and they can be coded in any order i.e. no fixed position. Keyword parameters always have specific value associated. This association is specified with use of ‘=’ sign. Example: - priority and class parameter in JOB statements. PGM= and PROC= are exceptions for this rule and they are positional parameters
'Continuing' a statement
While explaining operand filed we mentioned that if this field value goes longer than one line then continuation can be done by putting comma before going to next line. Now let’s understand coding rules for continuing a statement on other line.
- While we want to continue field to next line, make sure to interrupt the filed on current line by comma before position 72
- While we continue this field on next line, make sure to put slash (/) in position 1 and 2 and a space in position 3. After abiding this rule you can continue writing yours parameters begin any position from 4 through 16
Example:
Comment filed:-
If you have worked with other programming language, you must be aware of concept of comment. Comment are usually written to help programmer with description of program, logical concept and information related to changes. It never impacts how your program will behave. It is just for reference of programmer. Thus they are disregarded during execution. This field follows operand field. Comment filed and operand field must be separated by space. To continue comment filed on next line, we need to treat next line as comment statement. Comment statement is explained next
Comment statement:-
This is more appropriate than comment filed. As name suggests, the whole line or statement consist of comment. To write comment statement, one must begin with ‘//’ in column 1 and 2 and blank space in column 3. In order to continue comment statement on next line same coding rule has to be followed