EXEC STATEMENT(EXEC)
EXEC Statement is used to identify program name or procedure name.
Maximum we can code 255 EXEC statements in a JOB.
In EXEC statement has two kinds of parameters
Position parameter Keyword parameter
PGM TIME , COND
PROC REGION , PARM
If you not mention any thing default it takes PROC
PGM
This is a positional parameter which must be coded after EXEC with one blank. This parameter indicates the name of program (or) procedure name
Syntax
//STEPNAME EXEC PGM=REPORT (OR)
PROC = PROCEDURE NAME
PARM
It is keyword parameter and it is mainly used for passing the data to another program.
To pass input to Application program
To invoke complier option.
This is a keyword parameter at activity / step level must be coded with exec operand after PGM parameter.
This parameter allows MAX(100) characters.
To receive PARM parameter data, Cobol program must be coded with “Procedure Division Using Parameter ” option.
These parameters must be declared in the linkage section.
DATA DESCRIPTOR STATEMENT ( DD STMT)
It is used to identify files( input and output ) used in JCL
DD name act as a bridge b/w Cobol program and execution JCL
In DD statement has two kinds of parameters.
Position Parameter Keyword Parameter
* DSN,DISP
DATA SPACE,UNIT
DUMMY DCB,VOLUME
*
Position parameter at DD level used with SYSIN to pass data to Cobol programs this is known as In stream data any number of records can be passed to the program.
In stream data is used to pass values from JCL to Cobol dynamically.
To accept the values in Cobol program, we should have equivalent accept verbs.
Syntax
//SYSIN DD * ------- Entry of in stream data
100
200
/* ---------------------- End of in stream data
DATA
We can pass any thing to another program including special character
Syntax
//SYSIN DD DATA
100
/*
200
/*
DUMMY
All files are treated as End of the file
Syntax
//SYSIN DD DUMMY
NOTE
There is no input to the application all input files treated as End of the file.
DSN
Through DSN we can refer temporary / permanent file
Is a physical space or file where the records will be stored.
DISP
DISP parameter is used to identify the mode of the file.
DISP= ( STATUS, NORMAL , ABNORMAL )
TERMINATION TERMINATION
NEW DELETE DELETE
OLD KEEP KEEP
SHR CATLG CATLG
MOD UNCATLG UNCATLG
NEW Creating the data set first time
OLD Already created accessing the data set all resources are allocated exclusively . No other user can until is released by the current user. If dataset is not existing this creates.
SHR The data set can be accessed by multiple users at a time.
MOD Appending the records to the existing record
NOTE If the dataset is not existing , then MOD is assumed as NEW and writes records to the dataset.
2. MAINFRAMES REFRESHER PART-3 JCL
EXEC STATEMENT(EXEC)
EXEC Statement is used to identify program name or
procedure name.
Maximum we can code 255 EXEC statements in a JOB.
In EXEC statement has two kinds of parameters
Position parameter Keyword parameter
PGM TIME , COND
PROC REGION , PARM
If you not mention any thing default it takes PROC
3. MAINFRAMES REFRESHER PART-3 JCL
PGM
This is a positional parameter which must be coded after
EXEC with one blank. This parameter indicates the name of
program (or) procedure name
Syntax
//STEPNAME EXEC PGM=REPORT (OR)
PROC = PROCEDURE NAME
4. MAINFRAMES REFRESHER PART-3 JCL
PARM
It is keyword parameter and it is mainly used for passing the
data to another program.
To pass input to Application program
To invoke complier option.
This is a keyword parameter at activity / step level must be
coded with exec operand after PGM parameter.
This parameter allows MAX(100) characters.
To receive PARM parameter data, Cobol program must be
coded with “Procedure Division Using Parameter ” option.
These parameters must be declared in the linkage section.
5. MAINFRAMES REFRESHER PART-3 JCL
DATA DESCRIPTOR STATEMENT ( DD STMT)
It is used to identify files( input and output ) used in JCL
DD name act as a bridge b/w Cobol program and execution
JCL
In DD statement has two kinds of parameters.
Position Parameter Keyword Parameter
* DSN,DISP
DATA SPACE,UNIT
DUMMY DCB,VOLUME
6. MAINFRAMES REFRESHER PART-3 JCL
*
Position parameter at DD level used with SYSIN to pass
data to Cobol programs this is known as In stream data any
number of records can be passed to the program.
In stream data is used to pass values from JCL to Cobol
dynamically.
To accept the values in Cobol program, we should have
equivalent accept verbs.
Syntax
//SYSIN DD * ------- Entry of in stream data
100
200
/* ---------------------- End of in stream data
INPUT
7. MAINFRAMES REFRESHER PART-3 JCL
DATA
We can pass any thing to another program including special
character
Syntax
//SYSIN DD DATA
100
/*
200
/*
INPUT
8. MAINFRAMES REFRESHER PART-3 JCL
DUMMY
All files are treated as End of the file
Syntax
//SYSIN DD DUMMY
NOTE
There is no input to the application all input files treated as
End of the file.
9. MAINFRAMES REFRESHER PART-3 JCL
DSN
Through DSN we can refer temporary / permanent file
Is a physical space or file where the records will be stored.
o DISP
• DISP parameter is used to identify the mode of the file.
• DISP= ( STATUS, NORMAL , ABNORMAL )
TERMINATION TERMINATION
NEW DELETE DELETE
OLD KEEP KEEP
SHR CATLG CATLG
MOD UNCATLG UNCATLG
10. MAINFRAMES REFRESHER PART-3 JCL
NEW Creating the data set first time
OLD Already created accessing the data set all resources
are allocated exclusively . No other user can until is
released by the current user. If dataset is not
existing this creates.
SHR The data set can be accessed by multiple users at a
time.
MOD Appending the records to the existing record
NOTE If the dataset is not existing , then MOD is
assumed as NEW and writes records to the dataset.
11. MAINFRAMES REFRESHER PART-3 JCL
NORMAL All the parameters of normal are active when
the JOB executes successfully.
DELETE Dataset is deleted when job creates successfully
KEEP It keeps dataset in system. But it doesn’t create
any reference in CATLG
CATLG When job terminates successfully it is going to
create an index by a referencing name specified
in volume label. This keeps data set.
UNCATLG I resides in system, but it deletes volume label
name from CATLG like keep.
PASS To pass dataset to subsequence steps.
12. MAINFRAMES REFRESHER PART-3 JCL
ABNORMAL
It indicates the unsuccessful execution and allowed
parameters are similar to normal termination expect pass.
Default
DISP = (NEW,DELETE,DELETE)
13. MAINFRAMES REFRESHER PART-3 JCL
SPACE
This is a keyword parameter in DD Operand can be coded
anywhere after DD Operand .
This is used to request the storage for the dataset as per the
requirement .
The storage space is divided in to primary and secondary for
effective storage space utilization.
EX
Space = (TRK,(5,3,0),RLSE)
PRIMARY
SECONDARY
DIRECTORY BLOCKSTORAGE DEVICE
14. MAINFRAMES REFRESHER PART-3 JCL
CYLINDERS.BLOCKS,TRACKS AND RECORDS
Different types of STORAGES
o PRIMARY
o This is primary which is allocated to the data set while
creating.
o SECONDARY
o This is additional memory allocated in addition to the
primary memory.
o RLSE
o Is used to release the unused space when PGM
terminates successfully / unsuccessfully.
15. MAINFRAMES REFRESHER PART-3 JCL
DATA CONTROL BLOCKS
This contains the following parameters used to specify file
attributes.
EX
DCB=(LRECL=100,BLKSIZE=1000,RECFM=FB,DSORG=PS)
Logical record f/fb = fixed length
Length = 100 v/vb= variable length (PO/PS)
Fixed/variable length f/fb LRECL=100
v/vb LRECL=Maxlength+4
Block size(LRECL * 10)