Wednesday, April 1, 2009

Generation data Group (JCL)

                                                                       GDG

GDG:

GDG is a group of liked name datasets that are logically and chronologically related. A dataset in a GDG is called as generation.

Control cards:

DEFINE GDG (NAME (FACH01.GTP64.GDG) -

                         NOSCRATCH/SCRATCH   -

                          NOEMPTY/EMPTY -

                           LIMIT (N))

LIMIT: maximum number of generations that can be in GDG catalog entry

EMPTY: When limit is exceed uncatalog all generations

NOEMPTY: when the limit exceed uncatalog old generation

SCRATCH: when the limit exceeds delete any uncatalog generations

NOSCRATCH: when the limit exceeds don’t delete any uncatalog generations

 

Maximum number of generations that we can catalog is 255

Maximum number of generations that we can create is 9999

 

RELATIVE DATASET NAME:

Relative dataset name is a common form used refers the generations of GDG relative to the current generation.

 

ABSOLUTE DATASET NAME:

Absolute dataset name is generation number used to refer the generation of a GDG.

                            

GDG MODEL:

It is a model file used to supply the DCB attributes to the generations so that all the generations maintain same structure to increase the consistency.

The model must be in the same volume as the base GDG exists.

While creating GDG in multiple steps at the same time the generation numbers will not be updated till the end of job.

                                                                   

 

 

 

 

                                                               SYMBOLIC PARAMETERS

Symbolic parameters are variables in place of parameters in a procedure whose values can be changed while invoking the procedure.

Symbolic parameters can be preceded by & and can be of 8 characters long.

The values for the parameters can be supplied in the EXEC statement in which the procedure is invoked.

                                                                      CONCATANATION

Concatenation is a method of combining two or more datasets and making them to behave as single file is called as concatenation.

To concatenate the datasets we should not code the name of DD statements, only the first dataset contains the DD name

 

 

Procedures and Overriding parameters (JCL)

JOB CARD PARAMETERS:

Accounting information: It is appositional parameter used to identify the account number which will be charged for utilizing CPU time by the job on mainframe.

It can be of 1 to 143 characters long

 

Syntax: account number

                ‘Account number, additional info’

                ‘Account number’ in case of special characters

 

Programmer name: It is appositional parameter used to specify the name of programmer who submits the job.

It can be of 1 to 20 characters long

 

Syntax:  name

               ‘RANADE D’

 

CLASS:  It is a key word parameter used to assign a class to the job. it can be a to z or 0 to 9

It is installation dependent.

Syntax: class = a 

        

NOTIFY: it is keyword parameter used to specify the user id to which the status of job has to be notified.

Syntax NOTIFY=USERID

             NOTIFY=&SYSUID (The login USERID)

 

MSGCLASS: It is a keyword parameter used to specify how the JCL and output messages should be handled. It can be A to Z and 0 to 9.it is installation dependent.

Syntax: MSGCLASS=A

               MSGCLASS=9

 

 MSGLEVEL: It is a keyword parameter used to specify how much of the JCL and output messages should be printed.

Syntax: MSGLEVEL = (statements, messages)

 The value of statements can be 0, 1 and 2

0 = print only job card

1=print JCL and procedure statements

2=print only JCL messages

The value of messages can be 0, 1

0=print O/P messages only if job abends

1=print O/P messages regardless of job outcome

 

REGION: It is a key word parameter used to specify the amount of memory that the job can utilize for execution.

Syntax: REGION=1024K or 1024M

If the job utilizes more the memory specified in job card the job will be terminated abnormally.

We can specify the region parameter in exec statements also. In that case region will be limited to that particular execution statement only

   Ex: //STEP1 EXEC PGM=PGM1, REGION=1024K

If we specify the region parameter in both job card and execution statement the value in job card overrides the value in EXEC statements.

   Ex: //MTPLH01A JOB NOTIFY=MTLH01, REGION=1024K

     //STEP1 EXEC PGM=ADD, REGION=24K

     //STEP2 EXEC PGM=PGM2, REGION=34K

Step1 and step2 will be allocated 1024KB of memory

 

TIME: It is a key word parameter used to limit the time that the job can utilize.

Syntax: TIME = (M, SEC) M= 1 to 1439 and SEC= 1 to 59

If TIME= (M,) hen SEC =0

If TIME = (, SEC) then M=0

If the job utilizes more time than specified in job card the job will be terminated abnormally.

We can specify the TIME parameter in exec statements also. In that case time will be limited to that particular execution statement only.

Ex: //STEP1 EXEC PGM=PGM1, TIME= (1, 20)

If we specify the TIME parameter in both job card and execution statement the value in execution statement overrides the value in job statement.

 

Ex: //MTPLH01A JOB NOTIFY=MTLH01, TIME= (2, 40)

     //STEP1 EXEC PGM=ADD, TIME= (1, 20)

     //STEP2 EXEC PGM=PGM2, TIME= (1, 20)

Step1 will be allocated                 1 minute 20 seconds

Step1 will be allocated                 1 minute 20 seconds

 

TYPRUN: It is a keyword parameter used to control the type of execution.

Syntax TYPRUN=HOLD

It checks for syntax errors and the job will be held in the input queue .it will be executed when the user release the job.

TYPRUN=SCAN

It only checks for syntax errors.

TYPRUN=COPY

It copies the source content to the output device specified in message class parameter.

 

RESTART: it is a keyword parameter used to start the job from a step specified in the parameter other than the first step.

Syntax RESTART=STEP3

 

EXEC STATEMENT PARAMETERS:

 

We can write maximum of 255 steps.

PGM: it is a key word parameter used to specify the program name that is to be executed.

Syntax PGM=ADD

 

PARM: it is a key word parameter used to pass the information to program that is being executed in the step.

Syntax PARM= ’PRINT’

             PARM=’PRINT, PASS’

 

 

COND:  it is a key word parameter used to control the execution of subsequent steps.

 

Condition parameter on job card:

Syntax: COND= (COMPARISION CODE, CONDITON)

When executing each and every step the comparison code will be compared against the return code of prior step

Comparison code: this is a number from 0 t0 4095

Condition: GE, GT, LE, LT, NE, EQ

The first step will be executed normally. The remaining steps will be executed based on the condition.

Ex COND= (4, EQ)

4 = return code of previous step

If the condition is true the execution of second step will be skipped else it will be executed

 

Condition parameter on job card:

Syntax: COND= (COMPARISION CODE, CONDITON, STEPNAME)

STEPNAME = name of the step whose condition code is to be compared.

The comparison code will be compared against the return code of step which is mentioned

Ex:  COND= (4, EQ, STEP4)

4 = return code of STEP4

If the condition code is true the step on which the condition is coded will be skipped else it will be executed.

 

If condition is coded   both the statements job card condition overrides the condition code of step.

 

 

 

 

 

 

 

DD STATEMENT PARAMETERS:

We can specify maximum of 3273 DD statements

DISP: it is a key word parameter that specifies the current status of the dataset and what steps should be taken if the job terminates abnormally or normally

Syntax: DISP= (STATUS, NORMAL DISP, ABNORMAL DISP)

STATUS

 

NEW, OLD, SHR, MOD

NEW : The dataset is new

OLD: the dataset is old and the dataset will be used by the job exclusively

SHR: the dataset is old and the dataset will be used by the other jobs also at the same time

MOD: if he dataset is existing the data will be appended else it will be treated as new

 

NORMAL DISP

CATLG, UNCATLG, KEEP, PASS, DELETE

CATLG: After normal termination the dataset will be cataloged

UNCATLG: After normal termination the dataset will be uncataloged

DELETE: after normal termination the dataset will be deleted

KEEP: after normal termination the dataset will be kept

PASS: after normal termination the dataset will be passed to subsequent step

 

ABNORMAL DISP:

CATLG, UNCATLG, KEEP, DELETE

CATLG: After abnormal termination the dataset will be cataloged

UNCATLG: After abnormal termination the dataset will be uncataloged

DELETE: after abnormal termination the dataset will be deleted

KEEP: after abnormal termination the dataset will be kept

 

SPACE: it is keyword parameter used to allocate the memory for the dataset.

Syntax: SPACE= (UNIT, (P, S, D), RLSE)

UNIT=TRKS, CYL, number of blocks

P=primary allocation

S=secondary allocation

D=number of directory blocks in case of PDS otherwise it is 0

RLSE: If there is any unused space it will be released.

 

DSN OR DSNAME: it is a keyword parameter used to specify a dataset name that the program is using

It can be PS or PDS.

Ex: DSN=MTPLH01.DINU.PS

Ex: DSN=MTPLH01.DINU.PDS (M1)

 

 

DCB: it is a key word parameter used to specify the characteristics of dataset that is being used.

Syntax: DCB= (LRECL=N, BLKSIZE=M, RECFM=F/V/FB/VB/V)

N can be 1 to 32760 bytes

M can be 18 to 32760 bytes

 

UNIT: it is keyword parameter used to specify the unit name that the dataset is resided on.

Syntax: UNIT=SYSDA or SYSSQ, TAPE

 

VOL=SER= it is key word parameter used to specify the volume serial number in which the dataset is resided or to be created.

Syntax: VOL=SER=USER32

 

SPECIAL DD STATEMENTS:

 

JOBLIB: it is special statement used to specify a PDS library where the load modules that is being executed by all the steps of the job is located

It should always be after job and before execution statement

Syntax:  //JOBLIB DD DSN=MTPLH01.GTP64.PDS, DISP=SHR

 

STEPLIB: it is special statement used to specify a PDS library where the load modules that is being executed by the particular step is located

It should always be after step statement

Syntax:  //STEPLIB DD DSN=MTPLH01.GTP64.PDS, DISP=SHR

 

If both the statements are specified then the STEPLIB overrides the JOBLIB.

 

SYSPRINT: it is a special DD statement used to print the system messages to the output device

Syntax: //SYSPRINT DD SYSOUT=* star refers to the value in message class parameter

              //SYSPRINT DD DSN=A.B.C, DISP=SHR

 

SYSOUT: it is a special DD statement used to print the output messages to the output device

Syntax: //SYSOUT DD SYSOUT=* star refers to the value in message class parameter

              //SYSOUT DD DSN=A.B.C, DISP=SHR

 

SYSIN: it is a special DD statement used to print supply the output to the program that is being executed

Syntax: //SYSIN DD *

               1

               2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Job Card Parameters (JCL)

JOB CARD PARAMETERS:

Accounting information: It is appositional parameter used to identify the account number which will be charged for utilizing CPU time by the job on mainframe.

It can be of 1 to 143 characters long

 

Syntax: account number

                ‘Account number, additional info’

                ‘Account number’ in case of special characters

 

Programmer name: It is appositional parameter used to specify the name of programmer who submits the job.

It can be of 1 to 20 characters long

 

Syntax:  name

               ‘RANADE D’

 

CLASS:  It is a key word parameter used to assign a class to the job. it can be a to z or 0 to 9

It is installation dependent.

Syntax: class = a 

        

NOTIFY: it is keyword parameter used to specify the user id to which the status of job has to be notified.

Syntax NOTIFY=USERID

             NOTIFY=&SYSUID (The login USERID)

 

MSGCLASS: It is a keyword parameter used to specify how the JCL and output messages should be handled. It can be A to Z and 0 to 9.it is installation dependent.

Syntax: MSGCLASS=A

               MSGCLASS=9

 

 MSGLEVEL: It is a keyword parameter used to specify how much of the JCL and output messages should be printed.

Syntax: MSGLEVEL = (statements, messages)

 The value of statements can be 0, 1 and 2

0 = print only job card

1=print JCL and procedure statements

2=print only JCL messages

The value of messages can be 0, 1

0=print O/P messages only if job abends

1=print O/P messages regardless of job outcome

 

REGION: It is a key word parameter used to specify the amount of memory that the job can utilize for execution.

Syntax: REGION=1024K or 1024M

If the job utilizes more the memory specified in job card the job will be terminated abnormally.

We can specify the region parameter in exec statements also. In that case region will be limited to that particular execution statement only

   Ex: //STEP1 EXEC PGM=PGM1, REGION=1024K

If we specify the region parameter in both job card and execution statement the value in job card overrides the value in EXEC statements.

   Ex: //MTPLH01A JOB NOTIFY=MTLH01, REGION=1024K

     //STEP1 EXEC PGM=ADD, REGION=24K

     //STEP2 EXEC PGM=PGM2, REGION=34K

Step1 and step2 will be allocated 1024KB of memory

 

TIME: It is a key word parameter used to limit the time that the job can utilize.

Syntax: TIME = (M, SEC) M= 1 to 1439 and SEC= 1 to 59

If TIME= (M,) hen SEC =0

If TIME = (, SEC) then M=0

If the job utilizes more time than specified in job card the job will be terminated abnormally.

We can specify the TIME parameter in exec statements also. In that case time will be limited to that particular execution statement only.

Ex: //STEP1 EXEC PGM=PGM1, TIME= (1, 20)

If we specify the TIME parameter in both job card and execution statement the value in execution statement overrides the value in job statement.

 

Ex: //MTPLH01A JOB NOTIFY=MTLH01, TIME= (2, 40)

     //STEP1 EXEC PGM=ADD, TIME= (1, 20)

     //STEP2 EXEC PGM=PGM2, TIME= (1, 20)

Step1 will be allocated                 1 minute 20 seconds

Step1 will be allocated                 1 minute 20 seconds

 

TYPRUN: It is a keyword parameter used to control the type of execution.

Syntax TYPRUN=HOLD

It checks for syntax errors and the job will be held in the input queue .it will be executed when the user release the job.

TYPRUN=SCAN

It only checks for syntax errors.

TYPRUN=COPY

It copies the source content to the output device specified in message class parameter.

 

RESTART: it is a keyword parameter used to start the job from a step specified in the parameter other than the first step.

Syntax RESTART=STEP3

 

EXEC STATEMENT PARAMETERS:

 

We can write maximum of 255 steps.

PGM: it is a key word parameter used to specify the program name that is to be executed.

Syntax PGM=ADD

 

PARM: it is a key word parameter used to pass the information to program that is being executed in the step.

Syntax PARM= ’PRINT’

             PARM=’PRINT, PASS’

 

 

COND:  it is a key word parameter used to control the execution of subsequent steps.

 

Condition parameter on job card:

Syntax: COND= (COMPARISION CODE, CONDITON)

When executing each and every step the comparison code will be compared against the return code of prior step

Comparison code: this is a number from 0 t0 4095

Condition: GE, GT, LE, LT, NE, EQ

The first step will be executed normally. The remaining steps will be executed based on the condition.

Ex COND= (4, EQ)

4 = return code of previous step

If the condition is true the execution of second step will be skipped else it will be executed

 

Condition parameter on job card:

Syntax: COND= (COMPARISION CODE, CONDITON, STEPNAME)

STEPNAME = name of the step whose condition code is to be compared.

The comparison code will be compared against the return code of step which is mentioned

Ex:  COND= (4, EQ, STEP4)

4 = return code of STEP4

If the condition code is true the step on which the condition is coded will be skipped else it will be executed.

 

If condition is coded   both the statements job card condition overrides the condition code of step.

 

 

 

 

 

 

 

DD STATEMENT PARAMETERS:

We can specify maximum of 3273 DD statements

DISP: it is a key word parameter that specifies the current status of the dataset and what steps should be taken if the job terminates abnormally or normally

Syntax: DISP= (STATUS, NORMAL DISP, ABNORMAL DISP)

STATUS

 

NEW, OLD, SHR, MOD

NEW : The dataset is new

OLD: the dataset is old and the dataset will be used by the job exclusively

SHR: the dataset is old and the dataset will be used by the other jobs also at the same time

MOD: if he dataset is existing the data will be appended else it will be treated as new

 

NORMAL DISP

CATLG, UNCATLG, KEEP, PASS, DELETE

CATLG: After normal termination the dataset will be cataloged

UNCATLG: After normal termination the dataset will be uncataloged

DELETE: after normal termination the dataset will be deleted

KEEP: after normal termination the dataset will be kept

PASS: after normal termination the dataset will be passed to subsequent step

 

ABNORMAL DISP:

CATLG, UNCATLG, KEEP, DELETE

CATLG: After abnormal termination the dataset will be cataloged

UNCATLG: After abnormal termination the dataset will be uncataloged

DELETE: after abnormal termination the dataset will be deleted

KEEP: after abnormal termination the dataset will be kept

 

SPACE: it is keyword parameter used to allocate the memory for the dataset.

Syntax: SPACE= (UNIT, (P, S, D), RLSE)

UNIT=TRKS, CYL, number of blocks

P=primary allocation

S=secondary allocation

D=number of directory blocks in case of PDS otherwise it is 0

RLSE: If there is any unused space it will be released.

 

DSN OR DSNAME: it is a keyword parameter used to specify a dataset name that the program is using

It can be PS or PDS.

Ex: DSN=MTPLH01.DINU.PS

Ex: DSN=MTPLH01.DINU.PDS (M1)

 

 

DCB: it is a key word parameter used to specify the characteristics of dataset that is being used.

Syntax: DCB= (LRECL=N, BLKSIZE=M, RECFM=F/V/FB/VB/V)

N can be 1 to 32760 bytes

M can be 18 to 32760 bytes

 

UNIT: it is keyword parameter used to specify the unit name that the dataset is resided on.

Syntax: UNIT=SYSDA or SYSSQ, TAPE

 

VOL=SER= it is key word parameter used to specify the volume serial number in which the dataset is resided or to be created.

Syntax: VOL=SER=USER32

 

SPECIAL DD STATEMENTS:

 

JOBLIB: it is special statement used to specify a PDS library where the load modules that is being executed by all the steps of the job is located

It should always be after job and before execution statement

Syntax:  //JOBLIB DD DSN=MTPLH01.GTP64.PDS, DISP=SHR

 

STEPLIB: it is special statement used to specify a PDS library where the load modules that is being executed by the particular step is located

It should always be after step statement

Syntax:  //STEPLIB DD DSN=MTPLH01.GTP64.PDS, DISP=SHR

 

If both the statements are specified then the STEPLIB overrides the JOBLIB.

 

SYSPRINT: it is a special DD statement used to print the system messages to the output device

Syntax: //SYSPRINT DD SYSOUT=* star refers to the value in message class parameter

              //SYSPRINT DD DSN=A.B.C, DISP=SHR

 

SYSOUT: it is a special DD statement used to print the output messages to the output device

Syntax: //SYSOUT DD SYSOUT=* star refers to the value in message class parameter

              //SYSOUT DD DSN=A.B.C, DISP=SHR

 

SYSIN: it is a special DD statement used to print supply the output to the program that is being executed

Syntax: //SYSIN DD *

               1

               2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Job Control Language (JCL)

                                                       JCL

JCL: It is a job control language which controls the flow of programs on operating system.

It is a means of communication between a program that can be written in COBOL, ASSEMBER or PL/I and the MVS operating system.

 

JOB: A job is a set of JCL statements that consists of one (or several) steps, each of which is a request to run one specific program.

Using JCL we can tell the system what programs we can execute, what I/O files we are using and what is the input

Job Entry Subsystem (JES): It is a subsystem of the mainframe operating systems that manages jobs before and after the execution.

After submitting the job will be put into the JES queue.

The job will be checked for syntax errors. The job will be executed by basic control program (BCP) based on priority. The job will be send to the output queue.

 

JES3 (Job Entry Subsystem 3): It is a centralized system that the global processor can have centralized control over the local processors and distributes jobs to them

 

JES2 (Job Entry Subsystem 2): It is a decentralized system in which each processor's JES2 subsystem independently controls job

 

Initiator: it is a special address space where the job is mapped and executed

In order a job to be executed the job must me mapped to an initiator where each initiator is assigned a class and each initiator will execute the jobs that has the same class.

Types of statements in JCL:

JOB statement: It is a JCL statament which  identifies the beginning of job and specifies attributes that are required for the job.

EXEC statement: It is a JCL statament which  identifies the beginning of step and specifies the program that has to be executed.

DD statement: It is a JCL statament which  specifies the input and output files required for the program

 

 

 

 

JCL structure:

All jcl statememts consists of 5 types of fields.

1.Identifier:  two forward slashes at beginning of each jcl statements inj column 1 and column2. it is mandatory.

2.Name: it immediately follows the identifiler fileld at colomn 3.It is an optional field.it gives the name to the statement.it should not exceed 8 characters.

3.Operation field: it specifies the operation or type of statement.it must be preceded by one blank.it is mandatory.

4. Parameter filed: it contains the parameters required for the statement.multiple parameters will be seperated by comma.

5. comment field: it follows the last parameter and must be preceded by atleat one blank.

 

The maximum length of jcl statement is 72.

The continued statement should start with identifiers and parameters should start between 4 and 16.

 

Tyes of parameters:

Positional parameters: it should be coded in a particular order.must be followed by operation field.if positional parameters are not required we can leave it with comma.

Key word parameters: it can appear in any order and identified by equal to operator.

Positional key word parameter: the keyword parameter that should follow the operation field.

key word parameter that accepts positional sub parameters: the sub parameters must be positional

key word parameter that accepts key word parameters: the sub parameters can appear in any order

 

Parameters of JOB statement:

Accounting information:

Programmer name:

CLASS

MSGCLASS

NOTIFY

MSGLEVEL

REGION

TIME

RESTART

TYPRUN