Chapter 1. Introduction to JCL

Table of Contents

1.1. Syntax
1.1.1. JCL Control Statements
1.1.2. JES2 JCL Control Statements
1.2. Operands
1.2.1. Positional Operands
1.2.2. Keyword Operands
1.2.3. Notation
1.2.4. Examples
1.3. JCL
1.3.1. Start and End of JOB
1.3.2. Order of Statements

OpenFrame provides MVS (Multiple Virtual Storage) JCL which is equivalent to IBM Mainframe. This chapter describes the basic concept of MCL.

The following describes syntax of JCL control statements.

The following figure shows syntax of JCL control statements.


FieldDescription

Name

Specifies the name of a JCL statement. It is used to separate the statement from other statements or to allow the statement to be referenced. The name must begin in column 3 and have no more than eight characters. Alphabetic characters and numeric digits can be used. The first character must be an alphabetic character. Comment, delimiter, and null statements do not have a name.

Operation

Specifies the operation of a JCL statement. If the statement has a name, one or more empty spaces must be preceded by the name. If not, the operation must begin in column 4. Comment, delimiter, and null statements do not have an operation.

Operand

Specifies operands separated each by commas (,). Operands are written after an operation. One or more empty spaces are required between the operation and operands. Comment, delimiter, null, and PEND statements do not have an operand.

Comments

To describe comments after operands, one or more empty spaces are required between operands and comments. If operands are omitted in a statement that can have operands (such as JOB, EXEC, DD, and PROC statements), comments cannot be used. Null statements cannot have comments.

Continued operand

If a JCL control statement cannot be written in a single line, it can be written across multiple lines with the method described following this table. The continuation cannot be used for comment, delimiter, and null statements. For more information, refer to "Continuation of JCL Statements".

Ignored space

Arbitrary characters can be written in columns 73 to 80. Characters after column 80 are ignored by the system.

Continuation of JCL Statements

Continuation of operands, commands, and quoted character lines can be used as follows:

  • Continuation of operands 1

    • If the last operand ends with a comma (,) before column 71, it is determined that the continuation of operands will be used.

    • A continued line must begin with "//" in columns 1 and 2.

    • A continued line cannot contain a name.

    • Continued operands are written starting from column 4 until column 16.

  • Continuation of operands 2

    • If a character other than an empty space is written in column 72 when the last operand does not end with a comma (,) and comments are not described, it is determined that the continuation of operands will be used.

    • A continued line must begin with "//" in columns 1 and 2.

    • A continued line cannot contain a name.

    • Continued operands are written starting from column 4 until column 16. A comma (,) must be written first to indicate the start of operands.

  • Continuation of comments

    If a character other than an empty space is written in column 72 when comments are described after operands in a control statement that can have comments, it is determined that comments will be continued to the next line.

  • Continuation of quoted character lines

    If a value of an operand begins with a single quotation mark (') and there is no close single quotation mark in the same line, it is determined that the next line contains a part of the same input. The continued line must begin with "//" in columns 1 and 2, and the contents must begin in column 4 until column 16.

Examples of continuation are:

  • Example 1

    In the following example, it is determined that continuation is used according to the "continuation of operand 1" rule.

    123-------------------------------------------------------------------72
    //JOB1 JOB CLASS=A,MSGCLASS=A,COND=(0,EQ),
    //         MSGLEVEL=(1,1)
  • Example 2

    In the following example, the "continuation of operand 1" rule is applied even if comments are described after a comma (,).

    123-------------------------------------------------------------------72
    //JOB1 JOB CLASS=A,MSGCLASS=A,COND=(0,EQ), this is comment
    //         MSGLEVEL=(1,1)
  • Example 3

    In the following example, the "continuation of operand 1" and "continuation of comments" rules are applied because the last operand ends with a comma (,), and comments exist and column 72 is marked. If the two rules are met, the "continuation of operand 1" takes priority over the "continuation of comments" rule. Therefore, the contents in the next line are recognized as operands, not comments.

    123-------------------------------------------------------------------72
    //JOB1 JOB CLASS=A,MSGCLASS=A,COND=(0,EQ), this is comment             A
    //         MSGLEVEL=(1,1)
  • Example 4

    In the following example, the "continuation of operand 2" rule is applied because column 72 is marked although the last operand does not end with a comma (,) and it is without comments.

    123-------------------------------------------------------------------72
    //JOB1 JOB CLASS=A,MSGCLASS=A,COND=(0,EQ)                              B
    //         ,MSGLEVEL=(1,1)
  • Example 5

    In the following example, the "continuation of comments" rule is applied because the last operand does not end with a comma (,), comments exist and column 72 is marked. Therefore, the contents (MSGLEVEL=(1,1)) in the next line are recognized as comments.

    123-------------------------------------------------------------------72
    //JOB1 JOB CLASS=A,MSGCLASS=A,COND=(0,EQ) this is comment              C
    //         ,MSGLEVEL=(1,1)
  • Example 6

    In the following example, the "continuation of quoted character lines" rule is applied. The value of the PARM is "this is tmaxsoft program argument."

    123-------------------------------------------------------------------72
    //JOB1  JOB CLASS=A,MSGCLASS=A,COND=(0,EQ),MSGLEVEL=(1,1)
    //STEP1 EXEC PGM=TMAXSOFT,COND=(0,NE),PARM='this is tmaxsoft program a
    //      rgument'
  • Example 7

    In the following example, "tmaxsoft_" means that an empty space is preceded by "tmaxsoft." The empty space is considered as a part of the value. Therefore, the value of the PARM is "this is tmaxsoft program argument."

    123-------------------------------------------------------------------72
    //JOB1  JOB CLASS=A,MSGCLASS=A,COND=(0,EQ),MSGLEVEL=(1,1)
    //STEP1 EXEC PGM=TMAXSOFT,COND=(0,NE),PARM='this is tmaxsoft_
    //      program argument'

There are two methods for writing a JCL operand: positional operand and keyword operand.

Notation for operands is as follows:

  • [] (brackets)

    Operands enclosed in these symbols can be omitted.

    • Example

      The following description represents the following four cases.

      A[,B][,C]
      • A

      • A,B

      • A,C

      • A,B,C

  • {} (braces)

    Operands enclosed in these symbols are longitudinally aligned one by one, and one of them is selected.

    • Example

      The following description represents the following two cases.

      {B}
      {C}
      • B

      • C

  • | (vertical bar)

    When multiple operands are delimited by this symbol, one of them is selected.

    • Example

      The following description represents the following two cases.

      { PS | PSU }
      • PS

      • PSU

  • Bold

    If no value is specified in braces ({, }), the bold word is used by default.

    • Example

      In the following description, if the FREE parameter is omitted, it has END as the default value.

      FREE = {END | CLOSE}
  • …​ (ellipsis)

    The item that is immediately followed by this symbol can be repeatedly specified.

  • Specified Type

    Descriptions of each type are as follows:

    • Numeric digits

      Meaning

      0|1|2|3|4|5|6|7|8|9

      Example

      0, 1, 9

    • Alphabetic characters

      Meaning

      A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|$|#|@

      Example

      C,J,@,$

    • Special characters

      Meaning

      Arbitrary characters other than numeric digits and alphabetic characters. Among the characters, a comma (,), single quotation mark ('), equal sign (=), left parenthesis ((), right parenthesis ()), and blank space ( ) must be enclosed in single quotation marks (', ').

      Example

      , , . , / , ' , ( , ) , * , & , + , - , = , empty space

    • Alphanumeric characters

      Meaning

      Numeric digits, alphabetic characters, and combinations of those.

      Example

      A, 7, A56, 8X, ABC, 997

    • Unsigned integer

      Meaning

      Unsigned numeric digits and combinations of those.

      Example

      01, 375

    • Integer

      Meaning

      Signed or unsigned numeric digits and signed or unsigned combinations of those.

      Example

      99, +76, -143

    • Special character line

      Meaning

      Numeric digits, alphabetic characters, special characters, and combinations of those.

      Example

      32 A5, *315'?&A

    • Quoted character line

      Meaning

      <alphabetic characters, numeric digits> | '<special character lines>'. To use a single quotation mark (') in a special character line, specify the single quotation mark twice to make a system recognize a single quotation mark.

      A system considers two ampersands (&&) specified one after another as a single ampersand. It is the same as when only a single ampersand(&) is specified. If a quoted character line is enclosed in single quotation marks, the single quotation marks are not counted into the number of characters.

      Example

      '5&23' '8=/' 'A''B', 8X3B

    • Symbol name

      Meaning

      Combinations of numeric digits and alphabetic characters, beginning with an alphabetic character. The length can be up to eight characters.

      Example

      Z7@, LMN, A123BC

The following describes the start and end of JOB used in JCL and the order of statements.

JOB STEPs must be used in each JOB range. Therefore, an EXEC statement must be used after a JOB statement.

Order of JCL Control Statements

The order of JCL control statements is as follows:

  1. JOB statement

    Indicates the start of JOB. If there is a PRIORITY statement, a JOB statement must be used after the PRIORITY statement.

  2. EXEC statement

    There are following three cases.

    • When an EXEC statement is not used in a procedure, it must be used after JOB, JOGLIB DD, and JOBCAT DD statements and at the front of each JOB STEP.

    • When an EXEC statement is used in an input stream procedure, it must be used after a PROC statement and at the front of each procedure STEP.

    • When an EXEC statement is used in a catalog procedure, it must be used at the front of each procedure STEP, and after a PROC statement if there is a PROC statement.

  3. DD statement

    There are following two cases.

    • JOBLIB DD statements and JOBCAT DD statements

      Used just after a JOB statement and before an EXEC statement that defines the first JOB STEP. JES2 JCL control statement can be used between a JOB statement and these DD statements.

    • Other DD statements

      Used after an EXEC statement.

  4. Delimiter statement

    Used at the end of the SYSIN data set.

  5. Null statement

    Used at the end of JOB. It cannot be used in input stream procedures or catalog procedures.

  6. Comment statement

    Can be used in any positions within the range of JOB. However, it cannot be used in the in-stream data set.

  7. PROC statement

    There are following two cases.

    • In an input stream procedure

      Used at the front of each input stream procedure. Used after a JOB statement and before JOB STEP that calls the input stream procedure.

    • In a catalog procedure

      Used at the front of a catalog procedure.

  8. PEND statement

    Used at the end of each input stream procedure.

Order of JES2 JCL Control Statements

The order of JES2 JCL control statements is as follows:

  1. PRIORITY statement

    Used just before a JOB statement.

  2. Other statements than PRIORITY statement

    Can be used in anywhere in the statement.