Вы находитесь на странице: 1из 12
Job Control Language (JCL) Handout - Ver. 2.0

Job Control Language (JCL) Handout - Ver. 2.0

JOB CONTROL LANGUAGE

Participant’s Handout

BASIC FORMAT of a JCL statement

Column-No

1-2

3-10

12-15

17-72

JCL syntax

//

Step - name

Operation

Operands & Comments

Operation can follow the step-name with one blank-space between them and it is not// Step - name Operation Operands & Comments necessary that it should start from column 12.

necessary that it should start from column 12.

Similarly, Operands can follow the operation with one blank-space between them and it isand it is not necessary that it should start from column 12. not necessary that it

not necessary that it should start from column 17.

By the same way, comments can follow the operands with one blank-space between them.and it is not necessary that it should start from column 17. Any continuation line should

Any continuation line should start anywhere in the columns 4 - 16.can follow the operands with one blank-space between them. STATEMENTS AVAILABLE WITH JCL   STATEMENT PURPOSE

STATEMENTS AVAILABLE WITH JCL

 

STATEMENT

PURPOSE

JOB

Identifies a JOB and supplies accounting information apart from setting the environment for the JOB processing

EXEC

Identifies the JOB step by indicating the name of the application program or the procedure name to be executed

DD

Identifies a data set to be allocated for the JOB step

Delimiter ( /* )

Marks the end of an in-stream data set

Null

( // )

Marks the END of the JOB

Comment ( //* )

Indicates a comment statement

PROC

Marks the BEGINNING of a procedure

PEND

Marks the END of a procedure

INCLUDE

Copies statements from another library member into the JOB

IF / THEN / ELSE / ENDIF

Provides conditional execution of a JOB step

JCLLIB

Identifies a private procedure library

SET

Sets default values for symbolic variables

OUTPUT

Supplies options for SYSOUT processing

//* ANY STATEMENT STARTING WITH '//*' IS A COMMENT STATEMENT IN JCL. //*

Job Control Language (JCL) Handout - Ver. 2.0

Job Control Language (JCL) Handout - Ver. 2.0

OPTIONS AVAILABLE WITH ‘JOB’ STATEMENT

//jobname JOB [accounting info][ ,programmer name]

//

[ ,ADDRSPC={VIRT/REAL}]

//

[ ,CLASS=<jobclass>]

//

[ ,MSGCLASS=<msgclass>]

//

[ ,MSGLEVEL=(<stmt>,<msg>)]

//

[ ,COND=((<value>,<op>),

)]

//

[ ,LINES={<value>/[<value>][,action]}

//

[ ,PAGES={<value>/[<value>][,action]}

//

[ ,BYTES={<value>/[<value>][,action]}

//

[ ,CARDS={<value>/[<value>][,action]}

//

[ ,NOTIFY=<user-id>]

//

[ ,PASSWORD=<password>]

//

[ ,PERFORM=<group>]

//

[ ,PRTY=<priority>]

//

[ ,REGION={<value-K>/<value-M>}]

//

[ ,TIME={([<min>][,<sec>])/NOLIMIT/MAXIMUM}]

//

[ ,TYPERUN={COPY/HOLD/JCLHOLD/SCAN}]

//

[ ,USER=<user-id>]

//*

//*

OPTIONS

//*

//********** accounting information (ONLY for JES2) //* (pano,room,time,line,cards,forms,copies,log,linect) //*

//*

pano - programmer's account number,1-4 alphanumeric

//*

room - programmer's room number,1-4 alphanumeric

//*

time - job's execution time in mnts,1-4 digit

//*

line - no of lines job writes to sysout dataset,1-4 digit

//*

cards - no of cards job punches to sysout dataset,1-4 digit

//*

forms - installation-defined form-id,1-4 alphanumeric

//*

copies- no of copies job prints the sysout dataset,1-3 digit

//*

log

- except 'N', for any other char job is printed, 1 CHR

//*

linect- no of lines to be printed per page,1-3 digit

//* //********** programmer's name

//*

May or may-not be required, depending on the installation

//*

If required, installation may dictate specialized format

//* //********** ADDRSPC

//*

optional.

//*

specifies whether the application requires

//*

REAL / VIRTUAL memory for execution

//*

DEFAULT is 'VIRT'

//*

//*********

BYTES

(ONLY FOR MVS/ESA)

//*

optional.

//*

<value> specifies maximum number of bytes

//*

(in thousands) of sysout data the JOB can produce

Job Control Language (JCL) Handout - Ver. 2.0

Job Control Language (JCL) Handout - Ver. 2.0

//*

<value> -

1-6 digit; DEFAULT - system-defined

//*

<action> specifies action to be taken when limit is exceeded

//*

<action> -

WARNING/CANCEL/DUMP; DEFAULT - system-defined

//*

//*********

CARDS

(ONLY FOR MVS/ESA)

//*

optional.

//* <value> specifies maximum number of cards of SYSOUT data the JOB can produce

//*

<value> -

1-8 digit; DEFAULT - system-defined

//*

<action> specifies action to be taken when limit is exceeded

//*

<action> -

WARNING/CANCEL/DUMP; DEFAULT - system-defined

//*

//*********

CLASS

//*

optional.

//* specifies a single character JOB class, to schedule the JOB. Normally, in general,

//*

A

-

JOB will be executed within 15 mnts from submission

//*

B

-

JOB will be executed within 30 mnts from submission

//*

C

-

JOB will be executed within 60 mnts from submission

//*

D

-

JOB will be executed over night from submission

//*

H

-

JOB will be HELD until OPERATOR releases it

//*

L

-

JOB will be executed within 15 mnts from submission

//*

Further, each step will be limited to 1 mnt ex-time

//*

T

-

JOB requires TAPE processing

//*

//*********

COND

(for JOB statement)

//*

optional.

//*

specifies a condition, which if TRUE causes MVS to TERMINATE the JOB

//*

(<return-code>,<relational-operator>)

//*

return codes

//*

values

meaning

//*

0

Successful completion

//*

4

Minor error. But recovered

//*

8

Error inhibited successful execution

//*

12

Serious error than level'8', inhibit succ.

//*

16

Fatal error. Execution could not continue

//*

//*

relational operators

//*

GT

greater than

//*

GE

greater than or equal to

//*

LT

less than

//*

LE

less than or equal to

//*

EQ

equal to

//*

NE

not equal to

//*

//*********

LINES

(ONLY FOR MVS/ESA)

//*

Optional.

//*

<value> specifies maximum number of lines (thousands) of SYSOUT data the //*

JOB can produce

//*

<value> -

1-6 digit; DEFAULT - system-defined

//*

<action> specifies action to be taken when limit is exceeded

//*

<action> -

WARNING/CANCEL/DUMP; DEFAULT - system-defined

Job Control Language (JCL) Handout - Ver. 2.0

Job Control Language (JCL) Handout - Ver. 2.0

//*

//*********

MSGCLASS

//*

Optional.

//* Specifies a single character MSG class, to schedule the JOB output message to a

//* particular o/p class. Normally, DEFAULT o/p class is 'A'. If JOB is submitted from

//*

TSO, the o/p msgclass is HELD, normally.

//*

//*

A

-

O/P will be assigned to a high speed printer

//*

DEFAULT - System defined.

//*

//*********

//*

MSGLEVEL optional.

//*

Controls the amount of system messages produced for the JOB.

//*

//*

(<stmt>,<msg>)

//*

//*

stmt -

1 digit. specifies how JCL statements to be printed

value

//*

meaning

//*

0

prints only JOB statements

//*

1

prints JCL and PROCEDURE statements

//*

2

prints only JCL statements submitted

//*

//*

msg

-

1 digit. specifies how system messages to be printed

value

//*

meaning

//*

0

prints only STEP completion messages, on abnormal termination

//*

1

prints all messages

//*

//*********

//*

NOTIFY optional.

//*

Specifies a TSO user to be notified when the is completed.

//*

//*********

PAGES

(ONLY FOR MVS/ESA)

//*

optional.

//* <value> specifies maximum number of pages of sysout data, the JOB can produce.

//*

<value>

-

1-8 digit; DEFAULT - system-defined.

//*

//*

<action> specifies action to be taken when limit is exceeded.

//*

<action> -

WARNING/CANCEL/DUMP; DEFAULT - system-defined.

//*

//*********

PASSWORD

//*

May be required, depending on the installation, to supply a

//*

password to authorize the access to the system.

//*

//*********

PERFORM

//*

optional.

//*

Associates the JOB with a performance group defined in the

//*

installation. The value ranges between 1 - 999.

//*

//*********

PRTY

//*

optional.

Job Control Language (JCL) Handout - Ver. 2.0

Job Control Language (JCL) Handout - Ver. 2.0

//*

Specifies a number from 0 - 14 ( JES3 ) or 0 - 15 ( JES2 ),

//*

that indicates a JOB scheduling priority within the jobclass.

//*

//*********

//*

REGION optional.

//*

Sets a maximum, limit for the largest amount of virtual or

//*

real storage any of the job's steps may use.

//*

Declared either in Kilobytes or in Megabytes.

//*

If declared in K, should be an even number.

//*

If declared in M, can be any number, even or odd.

//*

Normally, DEFAULT is system defined, typically 256K.

//*

//*

If 0K or 0M is defined, then there is no limit for memory

//*

and the job can go to acquire the full private area of

//*

its address-space for each step.

//*

//*********

//*

TIME optional.

//*

sets a maximum limit for the amount of time the JOB can use

//*

the processor in minutes or seconds.

//*

(<mnts>[,<secs>])

//*

If mnts is specified as 1440, then no time checking is

//*

performed, as 1440 corresponds to 24 Hrs.

//*

For MVS/ESA alone, you can specify either NOLIMIT or MAXIMUM

//*

which means the JOB can run limitlessly or for a maximum time

//*

limit of 357,912 mnts.

//*

//*********

//*

TYPERUN optional.

//*

Indicates JES special processing.

//*

//*

COPY -

JOB stream will be printed as a sysout dataset, but

//*

not processed. (JES2 only)

//*

HOLD -

JOB will be HELD until operator explicitly RELEASEs

//*

it for processing.

//*

SCAN -

JOB will be NOT be executed, but it is scanned for

//*

syntax errors.

//*

JCLHOLD -

JOB is HELD even before it is SCAN’ed (JES2 only)

//*

//*********

//*

USER May be required, depending on the installation, to supply the

//*

user-id of the user who submits the JOB, to authorize the

//*

access to the system.

//*

//*

Job Control Language (JCL) Handout - Ver. 2.0

Job Control Language (JCL) Handout - Ver. 2.0

OPTIONS AVAILABLE WITH 'EXEC' STATEMENT

//*

//stepname EXEC PGM=<prg-name> / PROC=<cataloged-procedure-name>

//

[ ,ACCT=<account - information> ]

//

[ ,ADDRSPC={ VIRT / REAL } ]

//

[ ,COND=( [(<value>,<op>,<step>),

]

[,EVEN/ONLY] ) ]

//

[ ,DPRTY=( [<value1>] [<value2> ] ) ]

//

[ ,PARM=<information> ]

//

[ ,PERFORM=<group> ]

//

[ ,REGION={<value-K>/<value-M>} ]

//

[ ,TIME={([<min>][,<sec>]) / NOLIMIT / MAXIMUM } ]

//

[ ,RD={ R / RNC / NR / NC } ]

//* //********** accounting information (ONLY for JES2)

//*

(pano,room,time,line,cards,forms,copies,log,linect)

//*

//*

pano

- programmer's account number,1-4 alphanumeric

//*

room

- programmer's room number,1-4 alphanumeric

//*

time

- job's execution time in mnts,1-4 digit

//*

line

- no of lines job writes to sysout dataset,1-4 digit

//*

cards

- no of cards job punches to sysout dataset,1-4 digit

//*

forms

- installation-defined form-id,1-4 alphanumeric

//*

copies

- no of copies job prints the sysout dataset,1-3 digit

//*

log

- except 'N', for any other char job is printed, 1 CHR

//*

linect

- no of lines to be printed per page,1-3 digit

//*

For Explanation, refer JOB statement Handout.

//* //********** ADDRSPC

//*

optional.

//*

Specifies whether the application requires REAL / VIRTUAL memory for execution

//*

DEFAULT is 'VIRT'

//*

//*********

COND

( for EXEC statement )

//*

optional.

//*

specifies one or more conditions, which if TRUE causes MVS to BYPASS the STEP.

//*

( (<return-code>,<relational-operator>,<step-name>),

)

,EVEN/ONLY )

//*

return codes

//*

values

meaning

//*

0

Successful completion

//*

4

Minor error. But recovered

//*

8

Error inhibited successful execution

//*

12

Serious error than level'8',inhibit success.

 

//*

16

Fatal error. Execution could not continue

//*

relational operators

 

//*

GT

greater than

//*

GE

greater than or equal to

//*

LT

less than

//*

LE

less than or equal to

//*

EQ

equal to

Job Control Language (JCL) Handout - Ver. 2.0

Job Control Language (JCL) Handout - Ver. 2.0

//*

NE

not equal to

//*

//*

EVEN

-the step should execute even if a previous step has abended.

//*

ONLY

-the step should execute only if a previous step has abended.

//*

//*********

DPRTY

 

//*

optional.

//*Specifies a dispatching priority, which determines the step’s importance relative to //* other job steps that are currently executing.

//* //* Dispatching-priority = 16 * <value-1> + <value-2> //* //********** PARM

//*

//*Specifies any information that is passed to the program. For procedures OPTIONS

optional.

//*

can also be passed through PARM.

//*

//*********

PERFORM

//*

optional.

//*Associates the STEP with a performance group defined in the installation. The value

//*

ranges between 1 - 999.

//*

//*********

REGION

//*

optional.

//*Sets a maximum limit for the largest amount of virtual or real storage any of the

//*

steps to use.

//*

Declared either in Kilobytes or in Megabytes.

//*

If declared in K, should be an even number.

//*

If declared in M, can be any number, even or odd.

//*

Normally, DEFAULT is system defined, typically 256K.

//* If 0K or 0M is defined, then there is no limit for memory and the job can go and

//* acquire the full private area of its address-space for each step. //*

//*********

TIME

//*

optional.

//* sets a maximum limit for the amount of time the JOB can use the processor in

//*

minutes or seconds.

//*

(<mnts>[,<sec>])

//* //* For MVS/ESA alone, you can specify either NOLIMIT or MAXIMUM which means //* the JOB can run limitlessly or for a maximum time limit of 357,912 mnts.

//*

//*********

RD

(RESTART DEFINITION)

//*

optional.

RNC

RESTART

-

//*

Used to specify a systematic restart of the JOB, if it ABENDS.

//*

//*

R

-

RESTART with No Checkpoint

//*

NR -

No Automatic RESTART, but Checkpoints are Enabled

//*

NC

-

No Automatic RESTART, and Checkpoints are also Disabled

//*

Job Control Language (JCL) Handout - Ver. 2.0

Job Control Language (JCL) Handout - Ver. 2.0

OPTIONS AVAILABLE WITH ‘DD’ STATEMENT

//*

For IN-STREAM data set

//*

//ddname

DD { * / DATA } [ ,DLM=<xx>]

//*

//*********

* / DATA

//*

Indicates that in-stream data follows.

//*

If you code an ‘*’, the delimiter ‘/*’ or the next JCL statement ends the data .

//*

If you code DATA, you must include a delimiter statement to end the data.

//*********

DLM

//*

Specifies the characters that identify a delimiter statement.

//*

If omitted, DEFAULT is ‘/*’.

//*

//*

for SYSOUT data set

//*

//ddname

DD SYSOUT=<x>

//*

//*********

SYSOUT

//*Specifies a one character output class to be associated with the SYSOUT data set.

//*If you code an ‘*’, the output class you specified in the MSGCLASS parameter

//*

of the JOB statement is used.

 

//*

//*

for DASD data set

 

//*

//ddname

DD

[

DUMMY ]

//*

[ ,DSNAME=<data-set-name> ]

)

]

//*

[ ,DISP=(<status>,<norm-disp>,<abnorm-disp>) ]

//*

[ ,UNIT=<unit> ]

//*

[ ,VOL=SER=<vol-ser-numb> ]

//*

[ ,SPACE=(<unit>,(<pri>[,<sec>][,dir.]) [,RLSE][,{CONTIG/MXIG/ALX}]

//*

[,ROUND] ) ] [ ,AVGREC={U/K/M} ]

//*

//*

[ ,DCB=(<option>,<option>, [ ,LIKE=<data-set-name> ]

//*

[ ,STORCLAS=<storage-class> ]

//*

[ ,DATACLAS=<data-class> ]

//*

[ ,MGMTCLAS=<management-class> ]

//*

//*********

DUMMY

//*

Specifies that the file is dummy data set.

//*

No DASD I/O operations are performed.

//*

//*********

DSNAME / DSN

//*

Specifies the DASD file’s data-set name.

//*

//*********

DISP

//*

Specifies the file’s status, normal dispositions (successful processing of the file),

//*

abnormal dispositions (error in file processing ) .

Job Control Language (JCL) Handout - Ver. 2.0

Job Control Language (JCL) Handout - Ver. 2.0

//*

//*

<status>

 

//*

NEW

-

the data set does not exist and should be created.

//*

OLD

-

the data set exists and should be allocated for exclusive use.

//*

SHR

-

the data set exists and should be allocated for shared use.

//*

MOD

-

the data-set, if exists is allocated for exclusive use and is

//*

positioned at the end of the file, so additional records may be

//*

added after the last record. If not, the data set is created.

//*

If you also code VOL=SER, the data set must exist.

//*

DEFAULT status is NEW.

//*

//*

<normal-disposition> & <abnormal-disposition>

 

//*

DELETE -

The data set is deleted. If it was retrieved from the catalog, it is

//*

uncataloged.

-

 

//*

KEEP

The data set is retained.

//*

//*

CATLG

-

The data set is retained and a catalog entry is made, if it were not

//*

cataloged.

//*

UNCATLG

-

The data-set is retained but it’s catalog entry is removed, if it was

//*

already cataloged.

//*

PASS - The data set is retained for use by later job step.

//*

(PASS is for NORMAL DISPOSITION ONLY.)

//*

//*

DEFAULT values.

 

//*

normal-disposition

abnormal-disposition

//*

status NEW

DELETE

DELETE

//*

OLD, SHR, MOD

KEEP

KEEP

//*

//*********

UNIT

 

//*

Specifies the unit address, generic name, or group name that identifies the device

//*

where the file resides. NOT REQUIRED for CATALOGED data sets.

//*

//*********

VOL=SER

 

//*

Specifies a six character volume-serial-number/name of the volume that contains

//*

the file. NOT REQUIRED for CATALOGED data sets.

//*

//*********

//*

SPACE Specifies the DASD space to be allocated for the file.

//*

//*

//*

<unit> -Specifies the measure for the primary and secondary allocation. -

CYL

//*

TRK

-

cylinders, tracks,

//*

<deci> -

reps a block size.

//*

If the system is installed with SMS, we can also specify record size, where

//*

AVGREC parameter SHOULD be coded.

//*

//*

<primary>

Specifies the number of units to allocate for the file’s primary

//*

space allocation.

//*

Job Control Language (JCL) Handout - Ver. 2.0

Job Control Language (JCL) Handout - Ver. 2.0

//*

<secondary> Specifies the number of units to allocate for the file’s secondary

//*

space allocation.

//*

//*

<dir.>

Specifies the number of directory blocks to allocate for a

//*

partitioned data set.

//*

RLSE

//*

Specifies that space that’s allocated, but not used should be freed when the data

//*

set is closed.

//*

//*

CONTIG

//*

Specifies that the primary allocation must be satisfied in a single extent.

//*

//*

MXIG

//*

Specifies that the primary allocation should be the largest available extent on the

//*

volume.

//*

The MINIMUM size of the allocation is specified in the <primary> option.

//*

//*

ALX

//*

Specifies that up to five extents should be allocated.

//*

The MINIMUM size of each extent is specified in the <primary> option.

//*

//*

ROUND

//*

Specifies that the primary allocation should be made in terms of cylinders,

//*

even though the unit option specifies a block size.

//*

//*

//*********

AVGREC

(SMS systems only)

//*

Specifies that the allocation unit specified in the SPACE parameter represents

//*

record size and the values specified in the primary and secondary options of the

//*

SPACE parameter are in terms of UNITS / THOUSANDS / MILLIONS.

//*

value

meaning

//*

U

units

thousands

millions

( record size * 1 )

//*

K

( record size * 1024 )

//*

M

( record size * 1048576 )

//*

//*********

//*

DCB Specifies the options to be used for the file’s data control block.

//*

//*

//*

some commonly used DCB parameters. -

DSORG=<xx>

//*

PS

-

Specifies the data set’s organization, where xx is Physical Sequential

//*

PO

-

-

-

Partitioned

//*

DA

Direct

//*

IS

Indexed Sequential

//*

//*

BUFNO=<n>

-

-

Specifies the number of buffers to be allocated to the

//*

virtual storage for the data set

//*

<n>

any number between 1 – 255. DEFAULT is 5.

//*

Job Control Language (JCL) Handout - Ver. 2.0

Job Control Language (JCL) Handout - Ver. 2.0

//*

RECFM=<n>

-

Specifies

the

data

set’s

organization,

where

xx

is

//*

F

-

Fixed length, unblocked

 

//*

FB

-

Fixed length, Blocked

//*

V

-

Variable length, unblocked

//*

VB

-

Variable length, Blocked

//*

VBS

-

Variable length, Blocked. Spanned

//*

U

-

Undefined

//*

//*

LRECL=<n>

-

Specifies the length of the file’s records.

 

//*

//*

BLKSIZE=<n> -

Specifies the length of the file’s block size.

 

//*

For a Fixed Blocked file, normally the Block Size is a

//*

multiple of LRECL.

//*

//*********

LIKE

(SMS systems only)

 

//*

Copies data set characteristics from the specified data set.

 

//*

//*********

STORCLAS

(SMS systems only)

 

//*

Specifies the storage class for the data set.

 

//*

//*********

DATACLAS

(SMS systems only)

 

//*

Specifies the data class for the data set.

 

//*

//*********

MGMTCLAS

(SMS systems only)

 

//*

Specifies the management class for the data set.

 

//*

Job Control Language (JCL) Handout - Ver. 2.0

Job Control Language (JCL) Handout - Ver. 2.0

//*

THIS DOCUMENT GIVES AN ACCOUNT OF JCL PROCEDURE COMMANDS.

//*

//********* JCL PROCEDURES //*

//*

1.

Procedures cannot invoke another procedure.

//*

2.

Procedures cannot contain INSTREAM data.

//*

3.

Procedures cannot contain more than 255 JOB steps.

//*

4.

JOB cannot contain more than 15 INSTREAM procedures.

//*

5.

Under mentioned statements cannot be included in any procedure :

//*

>

JOB

//*

>

DD * or DD DATA

//*

>

JOBLIB DD

//*

>

JES2 / JES3 control statements

//*

//procname PROC [<symbolic-parameters & values>] //*

//*

<procname>

-

procedure name, 1-8 alpha-numeric / national characters.

//*

PROC

-

reserved word used to denote the starting of a procedure

//*

MANDATORY for INSTREAM procedures and

//*

OPTIONAL for CATALOGED procedures.

//*

<symbolic-parms>-

to set default values to symbolic parameters used in the proc`s.

//*

//*

//

PEND

//*

//*

PEND

-

denotes the end of a procedure.

//*

-

should NOT be coded for CATALOGED procedures.

//*

-

MANDATORY for INSTREAM procedures.

//*

//*

General syntax.

 

//*

//procname PROC

//

< other JCL statements >

//

PEND

( ONLY FOR INSTREAM )

//*

*** End of Document***