Welcome to the world of Mainframe. 欢迎来到大型机的中文世界!

Constructing JCL Statements


Constructing JCL Statements

JCL Statement Format

Job Control Language (JCL) is very precise. It has specific rules of grammar and syntax that must be followed. Many programming languages accept variable numbers of spaces, upper or lower case letters, and other inconsistent uses of commands. JCL must not contain any irregularities. The JCL will be rejected if it contains typographical errors (including extra or missing spaces or commas), fields in the wrong order, etc. JCL and JES2 statements (except for comments) must not contain lower case letters. Don’t worry about the specific commands for now. Just pay attention to the order and the syntax.

In this module, a space in a JCL statement is indicated by a caret symbol (^). Do not type the caret symbol! Type a space in its place!

Basic JCL Statements

Job Statement

The job statement names a job, supplies accounting and billing information, and supplies options to control processing of the job.

Execute Statement

The execute statement instructs the computer which program or procedure to execute.

Data Definition Statement

The data definition statement identifies data sets that will be used or created by the job and instructs the computer what to do with the data sets at the end of the job.

Comment Statement

The comment statement contains comments. It is used primarily to document a program and its resource requirements.

Delimiter Statement

The delimiter statement signifies the end of a job step.

Null Statement

The null statement signifies the end of a job.

Other JCL Statements

If you need more information about the JCL statements in this section, contact the Help Desk.

Procedure Statement

The procedure statement marks the beginning of an in-stream procedure and may mark the beginning of a cataloged procedure. It also assigns default values to parameters defined in the procedure.

Procedure End Statement

The procedure end statement marks the end of an in-stream procedure.

Control Statement

The control statement marks the beginning of one or more program control statements.

End Control Statement

The end control statement marks the end of one or more program control statements.

Output JCL Statement

The output JCL statement specifies the processing options that the job entry subsystem uses to print a sysout data set.

JCL Command Statement

The JCL command statement enters an MVS system operator command through the input stream. (The command statement is primarily used by the system operator.)

JCL Statement Fields

A JCL statement is organized into sections called fields. The computer expects to find certain information in specific locations, fields, within a statement. The five fields must always provide the same types of information and appear in the following order:

1. Identifier (ID) Field

2. Name Field

3. Operation Field

4. Operand Field

5. Comments Field (optional)

Example (A caret (^) indicates a space.):

//DDNAME^DD^DSN=U19999A.PROGRAM.DATA,DISP=SHR^Comme nt

// is in the Identifier Field

DDNAME is in the Name Field

DD is in the Operation Field

DSN=U19999A.PROGRAM.DATA,DISP=SHR is in the Operand Field

Comment is in the Comments Field

Identifier Field

The identifier field is the first field in a JCL statement. Two slashes, //, in positions 1 and 2 instruct the computer to expect a JCL statement. A slash and an asterisk (/*) in positions 1 and 2 identify a JES2 statement. If you are entering data, omit the identifier.

Name Field

The name field assigns a name to the statement to identify it for current use or later reference or both. The name begins in position 3 and consists of one to eight alphanumeric characters. The first character must be alphabetic. The name field is followed by at least one space.

Operation Field

The operation field identifies the type of JCL statement by specifying the statement’s function. The operation field is followed by at least one space.

Operand Field

The operand field contains information that determines how the JCL statement is processed. Multiple parameters must be separated by commas. Spaces must not be within or between the parameters.

Comments Field

The comments field contains information to remind you why you wrote the statement. The computer disregards this field. The comments field must be preceded by at least one space.

Position 72

Always leave this position blank.

Continuing a JCL Statement

When a JCL statement needs to be continued on another line, there are specific coding rules to follow.

1. Interrupt the field after a comma and before position 72.

2. Begin the next line with slashes in positions 1 and 2 and a space in position 3.

3. Continue the interrupted parameter or field beginning in any position from 4 through 16.

Example (A caret (^) indicates a space.):

//U99999A^JOB^,’NAME’,TIME=(1,20),

// CLASS=2,MSGCLASS=I,NOTIFY=*

The second line is a continuation of the first line.

Parameters

When you choose what to place in a specific field, you fill in parameters. Parameters provide the computer with the information it needs to determine what to do and how to do it. For example, the time parameter in the preceding example instructs the computer that the CPU should not process the job for longer than one minute and twenty seconds. Other parameters provide your name, billing information, etc. The two basic types of parameters are positional parameters and keyword parameters. All positional parameters must precede all keyword parameters.

Positional Parameters

A positional parameter must be placed in a specific position within the operand field. (If you want to omit a positional parameter, you must replace that parameter with a comma.)

Example (A caret (^) indicates a space.):

//U99999A^JOB^(*),’ANGELA COOK’

In this example, the two positional parameters are separated by a comma. The first parameter, (*), allows the system to determine accounting information from the TSO logon userid. (Accounting information is always positioned as the first parameter following the job name field.) The second parameter, ‘ANGELA COOK’, is the user’s name.

Keyword Parameters

Keyword parameters have no special position or order within the operand field. However, they follow any required positional parameters within a job statement. A keyword is entered followed by an equal sign and a value.

Example:

TIME=(1,30)

This parameter contains the keyword, TIME, followed by an equal sign and two values in parentheses. (This example instructs the computer that the CPU should not process the job for longer than one minute and 30 seconds.)

相关文章

  • Top Links

  • 功能

  • 文章归档