Thursday, 9 August 2012

JCL statements

There  are 3 types of JCL statements used

1) JOB  - Used for identification of JOB.
2) EXEC - Used for identification of Execution.
3) DD   - Used for identification of Data source.

Other statements are NULL statement and Comment statement.

JOB statements contains detail about JOB name programmer name etc.

EXEC statements contains name of program to be executed.

DD statement contains source and output dataset name.

At end JCL terminated by Null statement.

JOB statement:
This is first statement of JOB card.
It identifies beginning of JOB.
It contains positional parameter as well as Keywword parameter.

Positional parameter:

 
1) JOB accounting information

 2) Programmer name.

Keyword parameter:

 1) CLASS
 2) MSGCLASS
 3) MSGLEVEL
 4) PRIORITY
 5) NOTIFY
 6) COND
 7) TIME
 8) RESTART
 9) REGION
 10)TYPRUN

1) JOB Accounting Information.

This is used for billing or charge back purpose information.
In production environment there are many teams are working for different purposes so each of them have a different accounting ID for billing purpose.

Syntax:

(Account-number, additional accounting information)
Total number of character is 142.

You can write Accounting information like TEAM
If we omit this parameter then give comma.

2) Programmers Name

This parameter gives information about programmer who has written and submitted the JOB.
Max lenth is 20 char.

Example:

//IEFBR14 JOB ACCT, AVINASH
//IEBCOPY JOB ACCT, AVINASH

3) CLASS

Used to assign JOB class which decides nature of JOB.

Syntax:

CLASS=JOB class

JOB class may be from A-Z and from 0-9

Frankly speaking you dont need to give this parameter this is installation dependent.

4) PRTYThere are different classes as mentioned above and the schedular picks up the different classes JOB based on PRTY basis.

Syntax:

PRTY=number from 0-15.

This is also installation dependent you need not to specify this.

5) MSGCLASS

This parameter used to specify the output device to which output message like system message and JCL message to be routed

Syntax:

MSGCLASS=output-class-name

It is A-Z or 0-9

This is also installation dependent.


6) MSGLEVEL
As you have submitted the job then messages like JCL message, System message ,Log message are to be recorded on output device specified by MSGCLASS parameter.

Syntax:

MSGLEVEL=(statements,messages) failed

where statements may be a number from 0 to 2 and message value is either 0 or 1.

This parameter is also system defined.

1) statements value and its meaning0 means only Job related messages to be recorded.
1 means all JCL statements including procedure to be recorded
2 means only input JCL statement to be recorded.

2) Message value and its meaning

0 means JOB allocation or termination messages to be output if job terminates abnormally.
1 means JOB allocation or deallocation messages to be output even if job terminates normally or abnormally.

7) NOTIFY parameter

This parameter notify user about job completion whether it is successful or failed due to some reason.

Syntax:

NOTIFY=userid or &sysuid.

//jobname job,notify=&sysuid


8)TYPRUN
This parameter specifies enviroment for JOB execution.

Syntax:

TYPRUN=SCAN or HOLD or JCLHOLD or COPY

If TYPRUN=SCAN then it will SCAN the JCL statements for syntax error and reports it. This will not execute job even if no errors.

If TYPRUN=HOLD then JOB will held for execution until user released it.It will check for errors when JOB is submitted.

If TYPRUN=copy then job is printed as sysout datast but not processed.

9) RESTARTThis parameter is important one when a submitted job abends on step3 then to start the execution of same JOB from step3 use RESTART parameter.

Syntax:

RESTART=* or stepname or stepname.procstepname

where * indicates default first step.
Stepname specifies specific step name.
stepname.procstepname specifies start of specified step from a procedure.

Example:

//JOB1,RESTART=STEP3.STEP4



No comments:

Post a Comment