In this chapter we will discuss the parameters that are common to both JOB and EXEC statements. A JOB statement is used to specify information related to the job being submitted, while and EXEC statement is used to specify information related to the program or procedure that is being executed.
If storage is limited, then the operating system can be instructed to assign only a specific amount of storage for a job or job step. We have seen condition codes in the earlier chapter. Condition codes are generated at the end each job step, and indicates the status of the job. A job often contains several job steps, and sometimes the input of one job step is the output of a previous step. So we need to know whether the first job step was executed successfully or not. The operating system can be instructed on what to do, based on the condition code generated at the end of a job or each job step, thereby controlling the execution of subsequent jobs/job steps. CPU time is always valuable and it is be necessary to limit the amount of time that a job of job step is allowed to utilize. The operating system can be instructed as to how much time it should allow a job or job step to execute before it is terminated.
The instructions to the operating system regarding storage,conditional execution and time can be achieved by using the following parameters in the JOB & EXEC statements:
The REGION Parameter
At the time that a job is run, a default amount of workspace is automatically assigned to it. The default can be overridden by using the REGION parameter. You must specify enough storage space for the job or job step that is being submitted, otherwise your job will abend. The syntax of the REGION parameter can be in one of the following formats:
Where valuel is the storage in multiples of 1024 bytes and value2 is storage in multiples of one million bytes. The 'K' and 'M* must follow valuel or value2, REGION is an optional keyword parameter. If storage is specified in the 'K' format, then the value can be up to 7 digits long. If storage is specified in the 'M* format, then the value can be up to 4 digits. If REGION is specified in the 'K' format, then ft should be specified as an even- number. If it is not even, the system will automatically round it off. If REGION is specified in the 'M' format, then an even or odd number can be specified. If REGION is coded on both the JOB and EXEC statements, the REGION specification on the JOB statement will override that on the EXEC statement. If this parameter is omitted, a default region is assigned. All available storage is assigned to the job or job step, if REGION is coded as REGION =0K or REGION=0M.
The COND Parameter
Each step within a job sends a return code to the system upon completion. This is called the condition code. A condition code of 00 is returned upon successful completion of each job step. A non-zero condition code means unsuccessful completion of the job step. Sometimes, the execution of one job step depends upon the successful execution of a prior job step. The COND parameter is used to control the execution of subsequent job steps, depending on the condition code that is returned for a prior job step.
For example, consider a job with two steps. The first step backs up a file, and the second deletes the source file, if the back up operation is successful. If the file is not backed up successfully, it should not be deleted. The COND parameter can be used to control the execution of the second step based on the first step.
A return code is a number between 0 and 4095, and is issued by the system just before a program finishes executing. It is highly recommended that all executing programs issue meaningful return codes based on IBM established conventions. Some of the most common return codes are given below:
A COND parameter coded on the JOB statement applies to all job steps within that job, and it overrides COND parameters coded on the EXEC statement, if they exist.
The syntax of the COND parameter is COND= (comparison-code, condition), where comparison-code is number between 0 and 4095, and condition specifies the type of comparison to be made between the comparison-code that has been coded, and the return code of the prior step. You can specify more than one condition code within sets of parentheses. Each condition is OR'ed with the next. The valid operators are listed below: C
In the above example, assume that the step one (SEGS1) executes successfully. It will return a code of zero. Since the comparison code ^4) is not less than the retune code (0), the next step (SEGS2) will execute. Now if the SEGS2 returns a code of 004. Since the comparison code (4) is not less than the retune code (004), the next step (SEGS3) will also be executed.
In the above example, if the return code is less than 4 or return code is greater than 9 the job step SEGS2 will be skipped and the job will be terminated.
The COND parameter coded in the EXEC statement applies only to the job step that it is coded in. The job step is executed or bypassed, depending on the condition codes issued by one or more prior job steps. The COND parameter in the EXEC statement can be in any of the following formats:
The syntax of the COND parameter coded on the EXEC statement is similar to that coded on the JOB statement, except for a few optional additional parameters. Comparison-code as before is a number between 0 and 4095. Condition specifies the type of comparison to be made between the comparison-code that has been coded, and the return code of the prior step. The designations for condition are the same as for the JOB statement.
Stepname specifies the name of the preceding step whose return code is to be checked. If the test is true, then the job step that contains the COND parameter will be bypassed. If the test is not true the job step will be executed. The keyword EVEN is used to specify that the stepname specified is to execute, even if any prior steps terminate, abnormally. The keyword ONLY is used to specify that the stepname specified must be executed only if any prior steps have terminated abnormally.
In the above example, the COND parameter is used to specify that SEGS2 should be bypassed if 8 is equal to the return code issued by SEGS1.
In this example we are specifying that SEGS3 should be bypassed if 8 is greater than or equal to the return code issued by any of the prior job steps. In addition to this, SEGS2 is to be bypassed is 80 is less than or equal to the return code issued by SEGS1. Thus, a return code less than 8 or greater than 80 will result in step 3 being executed.
In the above example, the keyword EVEN is used to specify that the step SEGS2 is to be executed even if any previous steps terminate abnormally.
In the above example, the keyword ONLY is used to specify that the step SEGS2 is to be executed only if SEGS1 terminates abnormally.
If the condition parameter is not coded in the JOB or EXEC statements, then all the steps will be executed, regardless of the return codes of the prior step. This could prove to be dangerous and undesirable under some circumstances. A successful test for the COND parameter coded on the JOB statement results in all subsequent steps being bypassed. A successful test for the COND parameter coded on the EXEC statement results only in that job step being bypassed. Often, you only want to bypass a step, as opposed to bypassing the entire job. If the COND parameter is coded on the JOB statement as well as the EXEC statement, then the specification on the JOB statement nullifies the specification on the EXEC statement.
The TIME Parameter
This is an optional keyword parameter and is used to specify the amount of CPU time that a job or job step is permitted to utilize before it is terminated. Note that this parameter specifies the CPU time and not the clock time, system time or wait time. CPU time is the time that a job takes to execute. System time is the same as clock time. Wait time is the time that a job waits for I/O devices in order to execute.
If this parameter is coded on the JOB statement, it specifies the amount of CPU time that the job is allowed to use. If it is defined on the EXEC statement, it specifies the amount of CPU time that the job step is allowed to use. If this parameter is not specified, then the installation defined TIME parameter is used.
When coding the TIME parameter, always estimate a little more time than you expect your job to take. A job that exceeds the specified time limit, regardless of whether the TIME parameter is coded on the JOB or EXEC statement, will results in its termination. The TIME parameter can have any of the following formats:
Where minute is a number from 1 to 1439 (24 hrs.) and second is a number from 1 to 59. If you code only the minutes field the seconds defaults to zero. If you code only the seconds field the minutes defaults to zero. Coding TIME=0, will result in unpredictable behavior, and it is recommended that you avoid coding it this way.
If the TIME parameter is coded on the JOB statement as well as the EXEC statement, then the specification on the EXEC statement nullifies the specification on the JOB statement.
IBM Mainframe Related Interview Questions
|IBM Lotus Notes Interview Questions||IBM-CICS Interview Questions|
|COBOL Interview Questions||Linux Interview Questions|
|IBM-JCL Interview Questions||IBM Mainframe Interview Questions|
|IBM AIX Interview Questions||IBM WAS Administration Interview Questions|
|IBM Lotus Domino Interview Questions||IBM Integration Bus Interview Questions|
|Mainframe DB2 Interview Questions||Unix Production Support Interview Questions|
Ibm Mainframe Tutorial
Introduction To Software Development
Introduction To Ibm Mainframes
Tso And Ispf
Jes2, ]es3 And Sms
Introduction To Job Control Language (jcl)
The Job Statement
The Exec Statement
The Job And Exec Statements
The Dd Statement
Procedures And Symbolic Parameters
Generation Data Groups (gdg), Compile/link-edit And Run Jcls
Access Method Services (ams)
Additional Vsam Commands
Introduction To Rexx
Overview Of Rexx
Introduction To Cics
Exception Handling In Cics
Developing A Cics Application
Cics Programming Techniques
Basic Mapping Support (bms)
Transient Data Control
Temporary Storage Control
Interval And Task Control
Cics Application Design
Recovery And Restart
System Security And Intersystem Communication
Cics Debugging Facilities And Techniques
Bms Map Definition Macros And Copylib Members
Cics Response And Abend Codes
Data, Information And Information Processing
Introduction To Database Management Systems
Introduction To Relational Database Management Systems
Database Architecture And Data Modeling
Overview Of Db2
Structured Query Language (sql)
Data Security And Access
Db2 Application Development
Qmf And Db2i
Db2 Performance Monitoring, Utilities And Recovery/restart
Overview Of Information Management System (ims)
Introduction To Vs Cobol Ii
Overview Of Application Development In Vs Cobol Ii
Overview Of The Cobol Program
Sorting And Merging Files
Coding Cobol Programs That Run Under Cics. Ims, Db2 And Ispf
Compiling The Program
Link-editing The Program
Executing The Program
Improving Program Performance
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.