EXEC statement
As JOB conatains steps which have to be executing so EXEC statement tells compiler that this is my step which has to be executed.
It specifies program or procedure to be executed.
Syntax:
Stepname EXEC pgm or proc,parameters
A maximum 255 EXEC statements can be coded within a JOB.
Parameters on EXEC statements:
A) Positional parameters:
1)PGM
2)PROC
B) Keyword parameter:1)ACCT
2)COND
3)REGION
4)ADDRSPC
5)PARM
6)TIME
1) PGM parameter
This parameter specifies a program name or utility name which has to be executed from that step.
Syntax:
//STEPNAME EXEC pgm=program-name
PGM is first parameter on EXEC statement.
EXAMPLE:
STEP1 EXEC pgm=ADDPGM
2) PROC parameter
Used to call an instream procedure or catlog procedure.
Syntax:
stepname exec proc=procedure-name
or
stepname exec procname.
Example:
step1 exec proc=newproc
or
step1 exec newproc.
3) ACCT
This parameter specifies 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.
4) PARM
This will pass the information to your program.
Syntax:
PARM=information.
information is maximum 100 character in length.
//step1 exec pgm=pgm1,PARM= welcome to mainframe
Below parameters are common to JOB as well as EXEC statements
5) TIME
This parameter if specified then it will override the default installation TIME value.
Syntax:
TIME=(min,sec) or
(NOLIMIT) or
(MAXIMUM) or
(0)
min=from 0 to 357912 i.e max 248 days.
sec=from 0 to 59.
NOLIMIT = specifies JOB or JOB step can use unlimited processing time.
Maximum = Specifies JOB or JOB step uses maximum processing time i.e 248 days.
0 means JOB step can use remaning time from previous time and if it require more time to process then job will abend.
Examples:
//JOB1 JOB ,,TIME=(10,3)
//JOB1 JOB ,,TIME=10
//JOB1 JOB ,TIME=MAXIMUM
//STEP1 EXEC PGM=IEBCOPY,TIME=(,30)
//STEP1 EXEC PGM=pgm1,TIME=NOLIMIT
6) ADDRSPC
Specifies the JOB or JOB step use either virtual or Real storage.
Syntax:
ADDRSPC=(VIRT or REAL)
7) REGION
This parameter override default memory allocated to JOB or JOB step.
Syntax:
REGION= value in KB or
value in MB.
KB value is max. 7 digit and
MB value is max.4 digit
If REGION=0K or 0M ,then all the available storage will be assigned to that job.
Example:
//JOB1 JOB ,,REGION=126K
//STEP1 EXEC PGM=IEFBR14,REGION=95M
As JOB conatains steps which have to be executing so EXEC statement tells compiler that this is my step which has to be executed.
It specifies program or procedure to be executed.
Syntax:
Stepname EXEC pgm or proc,parameters
A maximum 255 EXEC statements can be coded within a JOB.
Parameters on EXEC statements:
A) Positional parameters:
1)PGM
2)PROC
B) Keyword parameter:1)ACCT
2)COND
3)REGION
4)ADDRSPC
5)PARM
6)TIME
1) PGM parameter
This parameter specifies a program name or utility name which has to be executed from that step.
Syntax:
//STEPNAME EXEC pgm=program-name
PGM is first parameter on EXEC statement.
EXAMPLE:
STEP1 EXEC pgm=ADDPGM
2) PROC parameter
Used to call an instream procedure or catlog procedure.
Syntax:
stepname exec proc=procedure-name
or
stepname exec procname.
Example:
step1 exec proc=newproc
or
step1 exec newproc.
3) ACCT
This parameter specifies 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.
4) PARM
This will pass the information to your program.
Syntax:
PARM=information.
information is maximum 100 character in length.
//step1 exec pgm=pgm1,PARM= welcome to mainframe
Below parameters are common to JOB as well as EXEC statements
5) TIME
This parameter if specified then it will override the default installation TIME value.
Syntax:
TIME=(min,sec) or
(NOLIMIT) or
(MAXIMUM) or
(0)
min=from 0 to 357912 i.e max 248 days.
sec=from 0 to 59.
NOLIMIT = specifies JOB or JOB step can use unlimited processing time.
Maximum = Specifies JOB or JOB step uses maximum processing time i.e 248 days.
0 means JOB step can use remaning time from previous time and if it require more time to process then job will abend.
Examples:
//JOB1 JOB ,,TIME=(10,3)
//JOB1 JOB ,,TIME=10
//JOB1 JOB ,TIME=MAXIMUM
//STEP1 EXEC PGM=IEBCOPY,TIME=(,30)
//STEP1 EXEC PGM=pgm1,TIME=NOLIMIT
6) ADDRSPC
Specifies the JOB or JOB step use either virtual or Real storage.
Syntax:
ADDRSPC=(VIRT or REAL)
7) REGION
This parameter override default memory allocated to JOB or JOB step.
Syntax:
REGION= value in KB or
value in MB.
KB value is max. 7 digit and
MB value is max.4 digit
If REGION=0K or 0M ,then all the available storage will be assigned to that job.
Example:
//JOB1 JOB ,,REGION=126K
//STEP1 EXEC PGM=IEFBR14,REGION=95M
No comments:
Post a Comment