JCL: Modifying Procedures
Unit 1. Overriding Procedures
In this course, you will learn about overriding parameters of an EXEC and DD statements in a procedure.
This unit covers overriding procedures in JCL. Overriding the DD statement as a way of changing values in parameters is discussed at length.
After completing this unit, you should be able to:
Apply the rules for overriding DD statements
Topic 1.1: Rules
*Specifying and Adding DD statementsA previous course showed you how using symbolic parameters makes procedures more flexible. The symbolic parameters allow you to specify different values for the JCL parameters where they were defined.
There are times however when you need to:
- Specify a value for a DD parameter which does not have any symbolic parameters
- Add an entire new DD statement
//COMPILE PROC STA=NEW,DSP=KEEP,OBJECT=MYOBJECT
//STEP1 EXEC PGM=IGYCRCTL
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSPRINT DD SYSOUT=A
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,&DSP)
*An Example
For example, the cataloged procedure shown here (COMPILE) provides symbolic parameters for the DSN and DISP parameters of SYSLIN.
//COMPILE PROC STA=NEW,DSP=KEEP,OBJECT=MYOBJECT
//STEP1 EXEC PGM=IGYCRCTL
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSPRINT DD SYSOUT=A
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,&DSP)
*What if...
...you wanted to specify a different value for UNIT on SYSLIN?
...you wanted to allow for more disk space for the COBOL work files defined on SYSUT1 through SYSUT7?
...you wanted to add a DCB parameter on SYSLIN?
...you wanted to add a SYSLIB statement?
*Your Options
One way to satisfy the requirements would be to rewrite the procedure and include additional symbolic parameters. Another is to supply the entire statement at execution time with the DDNAME parameter.
A third way is to override the procedure -- changing the DD statement whose parameter you want to modify or adding an entire new statement.
Override means to supply a new statement at execution time that:
- Changes a parameter
- Adds a parameter
- Nullifies a parameter
- Adds a new statement
*Overriding a DD Statement
To override a DD statement within a procedure, you:
- Supply your own DD statement when you execute the
PROC
- Give it the same name as the DD you want to
override
If you are executing an instream procedure, you have an alternative to overriding a DD.
You can modify the DD statement itself.
This is true because the procedure is part of the jobstream.
Overriding is more valuable when you are using cataloged procedures. To override a DD in a cataloged procedure, you must first know its ddname.
To find out the name, you can look at the JCL listing of a job that executed the procedure.
*Appending SYSIN
You've already seen this one -- overriding the procedure by adding a new statement. The SYSIN statement is appended to the procedure JCL. No special considerations are necessary.
//COMPILE PROC STA=NEW,DSP=KEEP,OBJECT=MYOBJECT
//STEP1 EXEC PGM=IGYCRCTL
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSPRINT DD SYSOUT=A
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,&DSP)
//COMPILE PROC STA=NEW,DSP=KEEP,OBJECT=MYOBJECT
//STEP1 EXEC PGM=IGYCRCTL
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSPRINT DD SYSOUT=A
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,&DSP)
*An Example
Here is the first example of overriding a statement that is part of the procedure. The SPACE parameter in this example is changed (overridden).
//COMPILE PROC STA=NEW,DSP=KEEP,OBJECT=MYOBJECT
//STEP1 EXEC PGM=IGYCRCTL
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSPRINT DD SYSOUT=A
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,&DSP)
//COMPILE PROC STA=NEW,DSP=KEEP,OBJECT=MYOBJECT
//STEP1 EXEC PGM=IGYCRCTL
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSPRINT DD SYSOUT=A
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,&DSP)
*Examples
Here four statements are overridden to change parameters by ddname.
//COMPILE PROC STA=NEW,DSP=KEEP,OBJECT=MYOBJECT
//STEP1 EXEC PGM=IGYCRCTL
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSPRINT DD SYSOUT=A
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,&DSP)
//COMPILE PROC STA=NEW,DSP=KEEP,OBJECT=MYOBJECT
//STEP1 EXEC PGM=IGYCRCTL
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSPRINT DD SYSOUT=A
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,&DSP)
*Parameter Added
Here a parameter is added to the statement in the override.
//COMPILE PROC STA=NEW,DSP=KEEP,OBJECT=MYOBJECT
//STEP1 EXEC PGM=IGYCRCTL
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSPRINT DD SYSOUT=A
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,&DSP)
//COMPILE PROC STA=NEW,DSP=KEEP,OBJECT=MYOBJECT
//STEP1 EXEC PGM=IGYCRCTL
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSPRINT DD SYSOUT=A
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,&DSP)
*Nullifying the Unit Parameter
This override nullifies the UNIT parameter on SYSLIN. Note that the coding is done the same way you nullified a symbolic parameter.
//COMPILE PROC STA=NEW,DSP=KEEP,OBJECT=MYOBJECT
//STEP1 EXEC PGM=IGYCRCTL
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSPRINT DD SYSOUT=A
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,&DSP)
//COMPILE PROC STA=NEW,DSP=KEEP,OBJECT=MYOBJECT
//STEP1 EXEC PGM=IGYCRCTL
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSPRINT DD SYSOUT=A
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,&DSP)
*The Six Rules
So much for the examples, let's get on with the rules.
There are six.
*Rule Number 1
The DD statements that you supply to override DD statements within a procedure must come BEFORE any DD statements you supply in ADDITION to the ones in the procedure.
As you saw in this example, the SYSLIN override is coded before SYSIN. The SYSLIN statement exists in the procedure, while the SYSIN does not.
//EXAMPLE2 JOB ...
//STEP1 EXEC COMPILE
//SYSIN DD *
COBOL program here
*Rule Number 2
If you override more than one DD statement, you must supply your DD statements in the SAME ORDER as they appear in the procedure.
Therefore, you need to know the names of the DD statements you are overriding as well as the order they appear in the procedure.
Note: This rule has an extension if the procedure has more than one step. You'll see it later in this course.
//EXAMPLE3 JOB ...
//STEP1 EXEC PROC=COMPILE
//SYSUT1 DD SPACE=(CYL,3)
//SYSUT2 DD SPACE=(CYL,3)
:
//SYSUT7 DD SPACE=(CYL,3)
//SYSIN DD*
COBOL program here
*Rule Number 3
When you override a DD statement you need to only supply the parameters that require new values.
The values for the remaining parameters in the DD statement will stay as defined on the DD in the procedure.
//EXAMPLE2 JOB ...
//STEP1 EXEC COMPILE
//SYSLIN DD SPACE=(TRK,20)
//SYSIN DD *
COBOL program here
*Rule Number 3
The UNIT parameter, however, does not change from the original:
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,&DSP)
SPACE=(TRK,20)
*Rule Number 4
The parameters in the override may be listed in any order, but all of the subparameter values for the parameter must be supplied.
Note: This rule has one exception. You'll see it later in this course.
//EXAMPLE4 JOB ...
//STEP1 EXEC COMPILE
//SYSLIN DD SPACE=(CYL,(1,1),RLSE)
//SYSIN DD *
COBOL program here
*Rule Number 5
If a parameter is to be nullified,
code it with an equal sign (=) and no value following.
//EXAMPLE5 JOB ...
//STEP1 EXEC COMPILE
//SYSLIN DD UNIT=
//SYSIN DD *
COBOL program here
*Rule Number 6
If the parameter in the override is mutually exclusive with the other parameters in the DD statement, do not nullify the other parameters.
The system nullifies them for you automatically. For example, to use the ddname parameter on any of the DD statements in the COMPILE procedure, code only that parameter.
The ddname is mutually exclusive with all parameters on the SYSLIN statement (DSN, UNIT, SPACE, DISP). Yet you don't nullify the others -- the system handles it. It is incorrect to code the override as follows: //SYSLIN DD DDNAME=SYSIN,DSN=,UNIT=,SPACE=,DISP=
//EXAMPLE6 JOB ...
//STEP1 EXEC COMPILE
//SYSLIN DD DDNAME=SYSIN
//SYSIN DD *
COBOL program here
*The SPACE Parameter
Let's go back to the examples of overriding procedures you saw before.
You'll see the effect of the overrides.
The SPACE parameter override in this example acts as if the SYSLIN DD statement were coded:
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(TRK,20),DISP=(&STA,&DSP)
//COMPILE PROC STA=NEW,DSP=KEEP,OBJECT=MYOBJECT
//STEP1 EXEC PGM=IGYCRCTL
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSPRINT DD SYSOUT=A
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,&DSP)
//COMPILE PROC STA=NEW,DSP=KEEP,OBJECT=MYOBJECT
//STEP1 EXEC PGM=IGYCRCTL
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSPRINT DD SYSOUT=A
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,&DSP)
*Overriding the SPACE Parameter
The SPACE parameter is overridden in this example too. These changes result in SYSUT DD statements as if they were coded:
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,3)
//COMPILE PROC STA=NEW,DSP=KEEP,OBJECT=MYOBJECT
//STEP1 EXEC PGM=IGYCRCTL
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSPRINT DD SYSOUT=A
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,&DSP)
//COMPILE PROC STA=NEW,DSP=KEEP,OBJECT=MYOBJECT
//STEP1 EXEC PGM=IGYCRCTL
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSPRINT DD SYSOUT=A
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,&DSP)
DCB Override
The DCB override in this example adds the parameter. It's as if the SYSLIN DD statement were coded:
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,&DSP),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
//COMPILE PROC STA=NEW,DSP=KEEP,OBJECT=MYOBJECT
//STEP1 EXEC PGM=IGYCRCTL
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSPRINT DD SYSOUT=A
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,&DSP)
//COMPILE PROC STA=NEW,DSP=KEEP,OBJECT=MYOBJECT
//STEP1 EXEC PGM=IGYCRCTL
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSPRINT DD SYSOUT=A
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,&DSP)
Topic 1.2: Unit 1 Summary
The following points were covered in this unit:One way to change the values of parameters in a cataloged procedure is to override the DD statement. To override a DD statement within a procedure, you can either supply your own DD statement when you execute the PROC or you can give it the same name as the DD you want to override.
The DD statements that you supply to override DD statements within a procedure must come before any DD statements you supply in addition to the ones in the procedure. If you override more than one DD statement, you must supply your DD statements in the same order as they appear in the procedure. Then you override a DD statement you need to supply only the parameters that require new values.
The parameters in the override may be listed in any order, but all of the subparameter values for the parameter must be supplied. If a parameter is to be nullified, code it with an equal sign (=) and no value following. If the parameter in the override is mutually exclusive with the other parameters in the DD statement, do not nullify the other parameters.
Unit 2. Statement Sequencing
In this unit, you will learn about statement sequencing and the impact of sequencing on DD statement overrides.
After completing this unit, you should be able to:
- Understand the impact of statement sequencing on the success and failure of override statements
*Rule on Statement Overrides
In the following pages, you will:
- See how overridden statements display on the JCL listing.
- Examine in more detail how the sequencing of DD statements
affects the result
*Rules for Overriding DD Statements
1. The overrides for DD statements within a procedure must come before any additional statements.
2. The overrides must be coded in the same order as the DD statements in the procedure.
3. The override needs to supply only the parameters that require new values.
4. All subparameters of a parameter must be supplied in an override of the parameter.
5. To nullify a parameter in an override, code the parameter, followed by an equal sign (=) and no value following.
6. Do not explicitly nullify mutually exclusive parameters.
*Where Displayed
The DD statements you override show in the JCL section of your job listing, provided that you coded
MSGLEVEL=(1,X)
where X can be 0, 1 or 2.
*Listing Order
The statements from the procedure are listed first, followed by the statements you supplied.
When you override a DD statement, however, the overriding DD -- the one you coded -- is listed with the statement from the procedure. The override immediately precedes the DD that it overrides.
An example should make this clearer.
1. // JOB ...,MSGLEVEL=(1,1)
2. //EXAMPLE EXEC COMPILE
3. XXSTEP1 EXEC PGM=IGYCRCTL
4. //SYSUT1 DD SPACE=(CYL,3)
X/SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
5. XXSYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
6. :
7. XXSYSUT7 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
8. XXSYSPRINT DD SYSOUT=A
9. XXSYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,&DSP)
10. //SYSIN DD *
*An Example
Here you see part of the JCL listing from this jobstream:
// JOB ...,MSGLEVEL=(1,1)
//EXAMPLE EXEC COMPILE
//SYSUT1 DD SPACE=(CYL,3)
//SYSIN DD *
COBOL program here
1. // JOB ...,MSGLEVEL=(1,1)
2. //EXAMPLE EXEC COMPILE
3. XXSTEP1 EXEC PGM=IGYCRCTL
4. //SYSUT1 DD SPACE=(CYL,3)
X/SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
5. XXSYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
6. :
7. XXSYSUT7 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
8. XXSYSPRINT DD SYSOUT=A
9. XXSYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,&DSP)
10. //SYSIN DD *
*Something to Notice
Notice that: (A) The SYSUT1 override DD lists before the statement it overrides in the procedure and starts with //. SYSUT1 from the procedure lists with X/. (B) The rest of the procedure statements list with XX. (C) Additions to the procedure display with //.
*Unsuccessful Overrides ...
You can tell that your override was unsuccessful if:
1. The DD that you supplied for the override was not listed among the procedure's JCL statements.
2. The DD statement from the procedure that you intended to override was listed with XX instead of X/.
*... And Reasons Why
Your override can be unsuccessful for one of two reasons:
A: The override DD does not come before the additional DD statements.
B: Multiple DD statement overrides are not coded in the same order as they appear in the procedure.
Question 14
1. //ERROR1 JOB ...,MSGLEVEL=(1,1)
2. // EXEC COMPILE
3. XXSTEP1 EXEC PGM=IGYCRCTL
4. XXSYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
5. XXSYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
6. :
7. XXSYSUT7 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
8. XXSYSPRINT DD SYSOUT=A
9. XXSYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,&DSP)
11. //SYSLIB DD DSN=SYS1.COBLIB,DISP=SHR
12. //SYSUT1 DD SPACE=(CYL,3)
*Two More DD Statements
SYSIN and SYSLIB are additional DD statements. They precede the intended SYSUT1 override.
This inappropriate sequencing causes the SYSUT1 DD to be treated as an additionally supplied DD and not an override.
1. //ERROR1 JOB ...,MSGLEVEL=(1,1)
2. // EXEC COMPILE
3. XXSTEP1 EXEC PGM=IGYCRCTL
4. XXSYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
5. XXSYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
6. :
7. XXSYSUT7 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
8. XXSYSPRINT DD SYSOUT=A
9. XXSYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,&DSP)
10. //SYSIN DD *
11. //SYSLIB DD DSN=SYS1.COBLIB,DISP=SHR
*A JCL Error
In addition, you will get a JCL error stating:
UNIT FIELD SPECIFIES INCORRECT DEVICE NAME.
This happens because the SYSUT1 DD was not intended to be a standalone DD and it is not complete.
A JCL error is another way to tell that your override was not successful!
*A Caution
Keep in mind, though, you will not always get a JCL error if your override is not successful.
Let's look at another example.
Question 15
1. //ERROR2 JOB ...,MSGLEVEL=(1,1)
2. // EXEC COMPILE
3. XXSTEP1 EXEC PGM=IGYCRCTL
4. XXSYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
X/SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
6. :
7. XXSYSUT7 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
8. XXSYSPRINT DD SYSOUT=A
9. XXSYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,&DSP)
11. //SYSIN DD *
*Another Error Message
The override for SYSUT2 was successful. But since the intended override for SYSUT1 was out of sequence, it was treated as an additional DD.
This will give you the JCL error message: ERROR2 STEP1 SYSUT1 - UNIT FIELD SPECIFIES INCORRECT DEVICE NAME
Let's take a look at the same example this time with a valid SYSUT1 statement.
1. //TRY3 JOB ...,MSGLEVEL=(1,1)
2. // EXEC COMPILE
3. XXSTEP1 EXEC PGM=IGYCRCTL
5. //SYSUT2 DD SPACE=(CYL,3)
X/SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
6. :
7. XXSYSUT7 DD UNIT=SYSDA,SPACE=(CYL,(1,1))
8. XXSYSPRINT DD SYSOUT=A
9. XXSYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,&DSP)
11. //SYSIN DD *
*Identically Named DD Statements
Now there are two DD statements with the same ddname! Since the SYSUT1 override is still out of place, the system didn't know to override the original.
The second statement -- the override -- is ignored.
COMPILE Examples
Following are some examples of overrides to the COMPILE procedure.
See if you can determine whether they are valid or invalid and why.
*A Special Case
One special case for DD statement sequencing remains concatenated data sets. When concatenating data sets, you have a group of DD statements. Only the first DD statement has a ddname. The remaining DD statements have blank ddnames.
Here's a typical example:
//SYSLIB DD DSN=SYS1.PRODLIB,DISP=SHR
// DD DSN=TEST.PRODLIB,DISP=SHR
// DD DSN=MY.PRODLIB,DISP=SHR
Concatenating data sets allows you to supply more than one data set under one ddname.
*Concatenation Situations
To override a specific DD statement within a concatenation you must indicate the one you want by its position. Without ddnames, you have no straightforward reference for the DD statements.
The position in the concatenation is indicated with placeholder DD statements. A placeholder DD has no operands -- for example: // DD
You follow the same approach to add a DD statement to a concatenation.
*An Example
This example of the COMPILE procedure shows the proper way to override the third concatenated data set on SYSLIB.
MY.MACLIB is accessed rather than MY.COPYLIB3 with this coding.
Procedure Jobstream
//COMPILE PROC ... //EXAMPLE JOB ...
//STEP1 EXEC ... //COB EXEC COMPILE
//SYSUT1 DD ...
...
//SYSUT7 DD ...
//SYSPRINT DD ...
//SYSLIN DD ... //SYSIN DD *
//SYSLIB DD DSN=MY.COPYLIB1,DISP=SHR COBOL program here
// DD DSN=MY.COPYLIB2,DISP=SHR
// DD DSN=MY.COPYLIB3,DISP=SHR
Topic 2.1: Unit 2 Summary
The following points were covered in this unit:When you override a DD statement, the overriding DD is listed with the statement from the procedure. The override immediately precedes the DD that it overrides.
You can tell that your override was unsuccessful if:
1. | The DD that you supplied for the override was not listed among the procedure's JCL statements. |
2. | The DD statement from the procedure that you intended to override was listed with XX instead of X/. |
Your override can be unsuccessful for one of two reasons:
1. | The override DD does not come before the additional DD statements. |
2. | Multiple DD statement overrides are not coded in the same order as they appear in the procedure. |
To override a specific DD statement within a concatenation you must indicate the one you want by its position.
Unit 3. Parameter Substitutions
In this unit, you will learn about supplying parameter values during overrides. You will also learn about the DCB parameter, which is an exception to the rule. Finally, you will learn about nullifying the DCB parameter.
After completing this unit, you should be able to:
- Supply, override, or nullify parameter values in a DD statement
*Parameter Substitution
Now you need the information about overrides that deal with parameter substitution.
Let's see if you remember the rules that apply.
Question 27
*An Example
To override a parameter on a procedure's DD statement, you must supply all the values that the parameter may require.
For example, if the procedure's DD statement specifies
DISP=(MOD,DELETE)
and you want to replace DELETE with KEEP you must code
DISP=(MOD,KEEP)
as the override.
*A JCL Error
In some instances -- where there is no default -- a JCL error will occur. For example, if you want to code RLSE in the SPACE parameter of SYSUT1, the valid way to code the override is:
//SYSUT1 DD SPACE=(CYL,1,RLSE)
The following approaches are invalid and will generate this JCL error: IEF646I REQUIRED POSITIONAL PARAMETER MISSING IN THE SPACE FIELD
Approach 1: //SYSUT1 DD SPACE=(,,RLSE)
Approach 2: //SYSUT1 DD SPACE=(CYL,,RLSE)
Approach 3: //SYSUT1 DD SPACE=(,1,RLSE)
*Dealing With Symbolic Parameters
Now let's look at what happens if you override a parameter that contains symbolic parameters. For the procedure definition on the left, you may choose to override SYSLIN with your own DD which contains values for all parameters.
The jobstream on the right shows one possible SYSLIN override.
Procedure Jobstream
//COMPILE PROC OBJECT=MYOBJ //EX1 JOB ...
//STEP1 EXEC PGM=IGYCRCTL //COB EXEC COMPILE,STA=,DSP=
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,2)
//SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,2)
: //SYSIN DD *
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,2) COBOL program here
//SYSPRINT DD SYSOUT=A
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,&DSP)
*Symbolic Parameter Substitution
Even though you are supplying the entire DD with all its parameters...
...you are still required to supply values for the symbolic parameters since there was no default value on the PROC statement.
The system will first perform the symbolic parameter substitution. Overriding is handled next.
In the previous example, both STA and DSP receive the null value from the statement: //COB EXEC COMPILE,STA=,DSP=
*The DCB Parameter
There are always exceptions to a rule!
In overriding parameters, the exception is the DCB parameter.
Let's look at it in more detail.
*The DCB Parameter Is An Exception
The DCB parameter of the DD statement is the only exception to the rule for overriding.
If you want to override a single subparameter within the DCB, you don't have to code all the subparameters.
Let's look at an example.
*Specifying a BLKSIZE
This version of the COMPILE procedure includes the DCB parameter.
You can execute the procedure and override SYSLIN to specify a different BLKSIZE by...
Procedure
//COMPILE PROC OBJECT=MYOBJ,STA=NEW,DSP=KEEP
//STEP1 EXEC PGM=IGYCRCTL
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,2)
//SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,2)
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,2)
//SYSPRINT DD SYSOUT=A
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,&DSP),
*Coding the BLKSIZE Subparameter
...coding only the BLKSIZE subparameter. The other subparameters stay the same.
Procedure Jobstream
//COMPILE PROC OBJECT=MYOBJ,STA=NEW,DSP=KEEP //EX1 JOB ...
//STEP1 EXEC PGM=IGYCRCTL //COB EXEC COMPILE
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,2)
//SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,2) //SYSIN DD *
: COBOL program here
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,2)
//SYSPRINT DD SYSOUT=A
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,&DSP),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=800)
*Nullifying Subparameters
The last item to consider regarding subparameters is nullifying them. To nullify the DCB parameter, you must nullify each individual subparameter.
Thus, this override is correct:
//SYSLIN DD DCB=(RECFM=,LRECL=,BLKSIZE=)
while this override is incorrect:
//SYSLIN DD DCB=
*An Example
To nullify certain subparameters within the DCB, you nullify only the subparameters desired.
This example shows RECFM and LRECL nullified:
//SYSLIN DD DCB=(RECFM=,LRECL=)
Topic 3.1: Unit 3 Summary
The following points were covered in this unit:- To override a parameter on a procedure's DD statement, you must
supply all the values that the parameter may require.
- The DCB parameter of the DD statement is the only
exception to the rule for overriding. If you want to override a single
subparameter within the DCB, you don't have to code all the
subparameters.
- To nullify the DCB parameter, you must nullify each of the subparameters.
Unit 4. Multi-Step DDnames
In this unit, you will learn about overriding multi-step procedures and qualifying overrides using procstepname.ddname.
After completing this unit, you should be able to:
- Override multi-step procedures
*Multi-step Procedures
The examples you've seen in this unit have used only one-step procedures. Now it's time to go on to more complex multi-step procedures.
When you use multi-step procedures, you have an additional piece of information to supply with your override. You must indicate the step of the procedure that the override belongs in.
Let's consider a two step cataloged procedure named COMPLINK.
//COB EXEC PGM=IGYCRCTL
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1)
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,1)
//SYSPRINT DD SYSOUT=A
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA,
// SPACE=(CYL,1),DISP=(&STA,&DSP)
*The Code
Here is the JCL for the compile step of the procedure.
//COB EXEC PGM=IGYCRCTL
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1)
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,1)
//SYSPRINT DD SYSOUT=A
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA,
// SPACE=(CYL,1),DISP=(&STA,&DSP)
//LINK EXEC PGM=IEWBLINK
//SYSPRINT DD SYSOUT=A
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1)
//SYSLIN DD DDNAME=SYSIN
//SYSLMOD DD DSN=LOADLIB(&PROG),DISP=SHR
*Some More Code
Here is the JCL for the compile step of the procedure.
Add to it the binder JCL.
//COMPLINK PROC OBJECT=TEMP,STA=NEW,
// DSP=DELETE,PROG=TEMPNAME
//COB EXEC PGM=IGYCRCTL
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1)
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,1)
//SYSPRINT DD SYSOUT=A
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA,
// SPACE=(CYL,1),DISP=(&STA,&DSP)
//LINK EXEC PGM=IEWBLINK
//SYSPRINT DD SYSOUT=A
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1)
//SYSLIN DD DDNAME=SYSIN
//SYSLMOD DD DSN=LOADLIB(&PROG),DISP=SHR
*The COMPLINK Procedure
Then you have the procedure COMPLINK.
*Executing a Procedure
Let's see how to execute this procedure to:
- Compile a COBOL program
- Place the object module in a data set (MYOBJ) on SYSDA
- Use MYOBJ as input to the binder
- Create a program named PROG1 in program library LOADLIB
- Delete MYOBJ at the end of the job
//COMPLINK PROC OBJECT=TEMP,STA=NEW,
// DSP=DELETE,PROG=TEMPNAME
//COB EXEC PGM=IGYCRCTL
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1)
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,1)
//SYSPRINT DD SYSOUT=A
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA,
// SPACE=(CYL,1),DISP=(&STA,&DSP)
//LINK EXEC PGM=IEWBLINK
//SYSPRINT DD SYSOUT=A
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1)
//SYSLIN DD DDNAME=SYSIN
//SYSLMOD DD DSN=LOADLIB(&PROG),DISP=SHR
*Running COMPLINK
Here you can see the JCL to run the COMPLINK procedure. Let's look at a couple of rules that apply to overrides for multi-step procedures.
//COMPLINK PROC OBJECT=TEMP,STA=NEW, //CMPLNK JOB ...
// DSP=DELETE,PROG=TEMPNAME //STEP1 EXEC COMPLINK,STA=NEW,
//COB EXEC PGM=IGYCRCTL // DSP=PASS,OBJECT=MYOBJ,
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1) // PROG=PROG1
: //COB.SYSIN DD *
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,1) COBOL program here
//SYSPRINT DD SYSOUT=A //LINK.SYSIN DD DSN=MYOBJ,
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA, // DISP=(OLD,DELETE)
// SPACE=(CYL,1),DISP=(&STA,&DSP)
//LINK EXEC PGM=IEWBLINK
//SYSPRINT DD SYSOUT=A
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1)
//SYSLIN DD DDNAME=SYSIN
//SYSLMOD DD DSN=LOADLIB(&PROG),DISP=SHR
*Rule 1
RULE 1: Qualify overrides with procstepname.ddname
Notice the additional qualifier that precedes the ddnames. It specifies the PROC step where the DD statement belongs.
You supply the procstepname, then a period (.) and finally the ddnames of the statement.
//COMPLINK PROC OBJECT=TEMP,STA=NEW, //CMPLNK JOB ...
// DSP=DELETE,PROG=TEMPNAME //STEP1 EXEC COMPLINK,STA=NEW,
//COB EXEC PGM=IGYCRCTL // DSP=PASS,OBJECT=MYOBJ,
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1) // PROG=PROG1
: DD *
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,1) COBOL program here
//SYSPRINT DD SYSOUT=A DD DSN=MYOBJ,
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA, // DISP=(OLD,DELETE)
// SPACE=(CYL,1),DISP=(&STA,&DSP)
//LINK EXEC PGM=IEWBLINK
//SYSPRINT DD SYSOUT=A
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1)
//SYSLIN DD DDNAME=SYSIN
//SYSLMOD DD DSN=LOADLIB(&PROG),DISP=SHR
*Rule 1 Continued
RULE 1: Qualify overrides with procstepname.ddname.
As you can see, it's important to use step names when you write procedures. If a PROC step doesn't have a name, you can't override the DD statements there. (You'll see one exception to this in a little bit.)
//COMPLINK PROC OBJECT=TEMP,STA=NEW, //CMPLNK JOB ...
// DSP=DELETE,PROG=TEMPNAME //STEP1 EXEC COMPLINK,STA=NEW,
//COB EXEC PGM=IGYCRCTL // DSP=PASS,OBJECT=MYOBJ,
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1) // PROG=PROG1
: //COB.SYSIN DD *
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,1) COBOL program here
//SYSPRINT DD SYSOUT=A //LINK.SYSIN DD DSN=MYOBJ,
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA, // DISP=(OLD,DELETE)
// SPACE=(CYL,1),DISP=(&STA,&DSP)
//LINK EXEC PGM=IEWBLINK
//SYSPRINT DD SYSOUT=A
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1)
//SYSLIN DD DDNAME=SYSIN
//SYSLMOD DD DSN=LOADLIB(&PROG),DISP=SHR
*Rule 1 Continued
RULE 1: Qualify overrides with procstepname.ddname.
As you can see, it's important to use step names when you write procedures. If a PROC step doesn't have a name, you can't override the DD statements there. (You'll see one exception to this in a little bit.)
//COMPLINK PROC OBJECT=TEMP,STA=NEW, //CMPLNK JOB ...
// DSP=DELETE,PROG=TEMPNAME //STEP1 EXEC COMPLINK,STA=NEW,
//COB EXEC PGM=IGYCRCTL // DSP=PASS,OBJECT=MYOBJ,
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1) // PROG=PROG1
: //COB.SYSIN DD *
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,1) COBOL program here
//SYSPRINT DD SYSOUT=A //LINK.SYSIN DD DSN=MYOBJ,
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA, // DISP=(OLD,DELETE)
// SPACE=(CYL,1),DISP=(&STA,&DSP)
//LINK EXEC PGM=IEWBLINK
//SYSPRINT DD SYSOUT=A
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1)
//SYSLIN DD DDNAME=SYSIN
//SYSLMOD DD DSN=LOADLIB(&PROG),DISP=SHR
*Rule 2
Rule 2: Multi-step overrides must be in PROC step order
Not only must you know the names of the PROC steps, you must know their order within the procedure. You supply all the overrides for the first step before you supply those for the second and so on.
//COMPLINK PROC OBJECT=TEMP,STA=NEW, //CMPLNK JOB ...
// DSP=DELETE,PROG=TEMPNAME //STEP1 EXEC COMPLINK,STA=NEW,
//COB EXEC PGM=IGYCRCTL // DSP=PASS,OBJECT=MYOBJ,
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1) // PROG=PROG1
: DD *
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,1) COBOL program here
//SYSPRINT DD SYSOUT=A DD DSN=MYOBJ,
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA, // DISP=(OLD,DELETE)
// SPACE=(CYL,1),DISP=(&STA,&DSP)
//LINK EXEC PGM=IEWBLINK
//SYSPRINT DD SYSOUT=A
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1)
//SYSLIN DD DDNAME=SYSIN
//SYSLMOD DD DSN=LOADLIB(&PROG),DISP=SHR
*Rule 2 Continued
Rule 2: Multi-step overrides must be in PROC step order.
The SYSIN statement for step LINK comes before the SYSIN for step COB. This is invalid because COB is defined before LINK in the procedure. Thus, a JCL error will occur with the message: IEF611I OVERRIDDEN STEP NOT FOUND IN PROCEDURE
//COMPLINK PROC OBJECT=TEMP,STA=NEW, //CMPLNK JOB ...
// DSP=DELETE,PROG=TEMPNAME //STEP1 EXEC COMPLINK,STA=NEW,
// DSP=PASS,OBJECT=MYOBJ,
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1) // PROG=PROG1
: //LINK.SYSIN DD DSN=MYOBJ,
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,1) // DISP=(OLD,DELETE)
//SYSPRINT DD SYSOUT=A //COB.SYSIN DD *
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA, COBOL program here
// SPACE=(CYL,1),DISP=(&STA,&DSP)
//SYSPRINT DD SYSOUT=A
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1)
//SYSLIN DD DDNAME=SYSIN
//SYSLMOD DD DSN=LOADLIB(&PROG),DISP=SHR
*Rule 2 Continued
Rule 2: Multi-step overrides must be in PROC step order.
When COB.SYSIN is encountered out of sequence, the system assumes it refers to a subsequent step. The system does not look back at steps already processed. It assumes the override is for a step following the current one -- LINK.
//COMPLINK PROC OBJECT=TEMP,STA=NEW, //CMPLNK JOB ...
// DSP=DELETE,PROG=TEMPNAME //STEP1 EXEC COMPLINK,STA=NEW,
// DSP=PASS,OBJECT=MYOBJ,
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1) // PROG=PROG1
: //LINK.SYSIN DD DSN=MYOBJ,
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,1) // DISP=(OLD,DELETE)
//SYSPRINT DD SYSOUT=A //COB.SYSIN DD *
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA, COBOL program here
// SPACE=(CYL,1),DISP=(&STA,&DSP)
//SYSPRINT DD SYSOUT=A
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1)
//SYSLIN DD DDNAME=SYSIN
//SYSLMOD DD DSN=LOADLIB(&PROG),DISP=SHR
*Rule 2 Continued
Rule 2: Multi-step overrides must be in PROC step order.
Based on this... you can have two steps in a procedure with the same name, as long as they are not consecutive.
BUT... this is NOT a good practice!
//COMPLINK PROC OBJECT=TEMP,STA=NEW, //CMPLNK JOB ...
// DSP=DELETE,PROG=TEMPNAME //STEP1 EXEC COMPLINK,STA=NEW,
// DSP=PASS,OBJECT=MYOBJ,
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1) // PROG=PROG1
: //LINK.SYSIN DD DSN=MYOBJ,
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,1) // DISP=(OLD,DELETE)
//SYSPRINT DD SYSOUT=A //COB.SYSIN DD *
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA, COBOL program here
// SPACE=(CYL,1),DISP=(&STA,&DSP)
//SYSPRINT DD SYSOUT=A
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1)
//SYSLIN DD DDNAME=SYSIN
//SYSLMOD DD DSN=LOADLIB(&PROG),DISP=SHR
*COPY Procedure
Here are the step names and their sequence in a procedure named COPY:
Step Sequence | Step Name |
#1 | STEPA |
#2 | STEPB |
#3 | STEPA |
#4 | STEPC |
What step number does the new SYSIN statement override?
// EXEC COPY
//STEPB.DDOUT DD SYSOUT=A
//STEPA.SYSIN DD *
Step #1 (STEPA) executes without overrides. Step #2 has an override for DDOUT. Step #3 receives the SYSIN override. Remember: the system always looks forward to subsequent steps.
*An Example
Before proceeding with overriding when not qualifying the ddnames, let's examine this example of valid DD overrides.
//COMPLINK PROC OBJECT=TEMP,STA=NEW, //CMPLNK JOB ...
// DSP=DELETE,PROG=TEMPNAME //STEP1 EXEC COMPLINK,STA=NEW,
//COB EXEC PGM=IGYCRCTL // DSP=PASS,OBJECT=MYOBJ,
1 //SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1) // PROG=PROG1
: //COB.SYSUT1 DD SPACE=(CYL,2)
2 //SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,1) //COB.SYSLIN DD DSN=OBJFILE,
3 //SYSPRINT DD SYSOUT=A // UNIT=3330,SPACE=(CYL,(1,1)),
4 //SYSLIN DD DSN=&OBJECT,UNIT=SYSDA, // VOL=SER=DISK01
// SPACE=(CYL,1),DISP=(&STA,&DSP) //COB.SYSIN DD *
//LINK EXEC PGM=IEWBLINK COBOL program here
5 //SYSPRINT DD SYSOUT=A //LINK.SYSLIN DD DSN=OBJFILE,
6 //SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1) // DISP=(OLD,DELETE)
7 //SYSLIN DD DDNAME=SYSIN
8 //SYSLMOD DD DSN=LOADLIB(&PROG),DISP=SHR
*Changes on SYSLIN
The changes on SYSLIN in COB are:
- DSN of OBJFILE instead of MYOBJ
- Specific disk which is UNIT=3330
- Secondary allocation of 1 cylinder in SPACE
//COMPLINK PROC OBJECT=TEMP,STA=NEW, //CMPLNK JOB ...
// DSP=DELETE,PROG=TEMPNAME //STEP1 EXEC COMPLINK,STA=NEW,
//COB EXEC PGM=IGYCRCTL // DSP=PASS,OBJECT=MYOBJ,
1 //SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1) // PROG=PROG1
: //COB.SYSUT1 DD SPACE=(CYL,2)
2 //SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,1) //COB.SYSLIN DD DSN=OBJFILE,
3 //SYSPRINT DD SYSOUT=A // UNIT=3330,SPACE=(CYL,(1,1)),
4 //SYSLIN DD DSN=&OBJECT,UNIT=SYSDA, //
// SPACE=(CYL,1),DISP=(&STA,&DSP) //COB.SYSIN DD *
//LINK EXEC PGM=IEWBLINK COBOL program here
5 //SYSPRINT DD SYSOUT=A //LINK.SYSLIN DD DSN=OBJFILE,
6 //SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1) // DISP=(OLD,DELETE)
7 //SYSLIN DD DDNAME=SYSIN
8 //SYSLMOD DD DSN=LOADLIB(&PROG),DISP=SHR
*Overriding the SYSLIN Statement
This example showed that even though
DDNAME=SYSIN of SYSLIN indicates you are to supply a SYSIN statement with object module information...
...you can choose to override the SYSLIN statement, supplying the object module information. There is a difference, however.
//COMPLINK PROC OBJECT=TEMP,STA=NEW, //CMPLNK JOB ...
// DSP=DELETE,PROG=TEMPNAME //STEP1 EXEC COMPLINK,STA=NEW,
//COB EXEC PGM=IGYCRCTL // DSP=PASS,OBJECT=MYOBJ,
1 //SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1) // PROG=PROG1
: //COB.SYSUT1 DD SPACE=(CYL,2)
2 //SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,1) //COB.SYSLIN DD DSN=OBJFILE,
3 //SYSPRINT DD SYSOUT=A // UNIT=3330,SPACE=(CYL,(1,1)),
4 //SYSLIN DD DSN=&OBJECT,UNIT=SYSDA, // VOL=SER=DISK01
// SPACE=(CYL,1),DISP=(&STA,&DSP) //COB.SYSIN DD *
//LINK EXEC PGM=IEWBLINK COBOL program here
5 //SYSPRINT DD SYSOUT=A //LINK.SYSLIN DD DSN=OBJFILE,
6 //SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1) // DISP=(OLD,DELETE)
7 //SYSLIN DD DDNAME=SYSIN
8 //SYSLMOD DD DSN=LOADLIB(&PROG),DISP=SHR
*Placing the SYSLIN DD
If you add the SYSIN DD named in the DDNAME= parameter, you can place it anywhere -- following the overrides for the step.
By choosing to override SYSLIN, you have to code the override statement in sequence -- as it appears in the procedure.
//COMPLINK PROC OBJECT=TEMP,STA=NEW, //CMPLNK JOB ...
// DSP=DELETE,PROG=TEMPNAME //STEP1 EXEC COMPLINK,STA=NEW,
//COB EXEC PGM=IGYCRCTL // DSP=PASS,OBJECT=MYOBJ,
1 //SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1) // PROG=PROG1
: //COB.SYSUT1 DD SPACE=(CYL,2)
2 //SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,1) //COB.SYSLIN DD DSN=OBJFILE,
3 //SYSPRINT DD SYSOUT=A // UNIT=3330,SPACE=(CYL,(1,1)),
4 //SYSLIN DD DSN=&OBJECT,UNIT=SYSDA, // VOL=SER=DISK01
// SPACE=(CYL,1),DISP=(&STA,&DSP) //COB.SYSIN DD *
//LINK EXEC PGM=IEWBLINK COBOL program here
5 //SYSPRINT DD SYSOUT=A //LINK.SYSLIN DD DSN=OBJFILE,
6 //SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1) // DISP=(OLD,DELETE)
7 //SYSLIN DD DDNAME=SYSIN
8 //SYSLMOD DD DSN=LOADLIB(&PROG),DISP=SHR
*A Recommended Practice
Note also that the example shown here shows the overrides (SYSUT1 and SYSLIN) in the same order as the DD statements. This is not required, but it is a recommended coding practice. When you specify the step you're overriding, the overrides may appear in any order for that step. Keep in mind that added statements (SYSIN) must follow the overrides for the step.
//COMPLINK PROC OBJECT=TEMP,STA=NEW, //CMPLNK JOB ...
// DSP=DELETE,PROG=TEMPNAME //STEP1 EXEC COMPLINK,STA=NEW,
//COB EXEC PGM=IGYCRCTL // DSP=PASS,OBJECT=MYOBJ,
1 //SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1) // PROG=PROG1
: //COB.SYSUT1 DD SPACE=(CYL,2)
2 //SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,1) //COB.SYSLIN DD DSN=OBJFILE,
3 //SYSPRINT DD SYSOUT=A // UNIT=3330,SPACE=(CYL,(1,1)),
4 //SYSLIN DD DSN=&OBJECT,UNIT=SYSDA, // VOL=SER=DISK01
// SPACE=(CYL,1),DISP=(&STA,&DSP) //COB.SYSIN DD *
//LINK EXEC PGM=IEWBLINK COBOL program here
5 //SYSPRINT DD SYSOUT=A //LINK.SYSLIN DD DSN=OBJFILE,
6 //SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1) // DISP=(OLD,DELETE)
7 //SYSLIN DD DDNAME=SYSIN
8 //SYSLMOD DD DSN=LOADLIB(&PROG),DISP=SHR
*When Sequence Becomes an Issue
Overriding is simple when you're only overriding one DD statement of a PROC step. Sequence is not an issue then!
Now let's see what happens when you do not qualify the ddnames in an override.
//COMPLINK PROC OBJECT=TEMP,STA=NEW, //CMPLNK JOB ...
// DSP=DELETE,PROG=TEMPNAME //STEP1 EXEC COMPLINK,STA=NEW,
//COB EXEC PGM=IGYCRCTL // DSP=PASS,OBJECT=MYOBJ,
1 //SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1) // PROG=PROG1
: //COB.SYSUT1 DD SPACE=(CYL,2)
2 //SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,1) //COB.SYSLIN DD DSN=OBJFILE,
3 //SYSPRINT DD SYSOUT=A // UNIT=3330,SPACE=(CYL,(1,1)),
4 //SYSLIN DD DSN=&OBJECT,UNIT=SYSDA, // VOL=SER=DISK01
// SPACE=(CYL,1),DISP=(&STA,&DSP) //COB.SYSIN DD *
//LINK EXEC PGM=IEWBLINK COBOL program here
5 //SYSPRINT DD SYSOUT=A //LINK.SYSLIN DD DSN=OBJFILE,
6 //SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1) // DISP=(OLD,DELETE)
7 //SYSLIN DD DDNAME=SYSIN
8 //SYSLMOD DD DSN=LOADLIB(&PROG),DISP=SHR
*Omitting procstepname
If you omit the ddnames qualifier (procstepname.), the DD statement will be used with the first step in the procedure.
Let's see how this applies to the COMPLINK procedure.
*An Example
In the example, the SYSIN statement is added to the COB step. Without a ddnames qualifier, the statement is used with the first step of the procedure.
//COMPLINK PROC OBJECT=TEMP,STA=NEW, //CMPLNK JOB ...
// DSP=DELETE,PROG=TEMPNAME //STEP1 EXEC COMPLINK,STA=NEW,
//COB EXEC PGM=IGYCRCTL // DSP=PASS,OBJECT=MYOBJ,
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1) // PROG=PROG1
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,1) COBOL program here
//SYSPRINT DD SYSOUT=A
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA,
// SPACE=(CYL,1),DISP=(&STA,&DSP)
//LINK EXEC PGM=IEWBLINK
//SYSPRINT DD SYSOUT=A
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1)
//SYSLIN DD DDNAME=SYSIN
//SYSLMOD DD DSN=LOADLIB(&PROG),DISP=SHR
DD statements with Qualified ddnames
What if you supply a DD statement with a qualified ddnames and follow it with DD statements with unqualified ddnames?
The result is the DDs without qualified ddnames will be used in the same PROC step as the DD with the qualified name.
Let's see how this looks in the example.
*The COB Step
The COB.SYSUT1 statement and the following two (SYSLIN and SYSIN) apply to the COB step of the procedure.
LINK.SYSUT1 points to the LINK step. Thus, the SYSLIN and SYSLMOD that follow it also refer to the LINK step.
//COMPLINK PROC OBJECT=TEMP,STA=NEW, //CMPLNK JOB ...
// DSP=DELETE,PROG=TEMPNAME //STEP1 EXEC COMPLINK,STA=NEW,
//COB EXEC PGM=IGYCRCTL // DSP=PASS
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1)
: //SYSLIN DD DSN=OBJFILE,UNIT=3350,
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,1) // SPACE=(CYL,(1,1)),
//SYSPRINT DD SYSOUT=A // VOL=SER=DISK01
//SYSLIN DD DSN=&OBJECT,UNIT=SYSDA, //SYSIN DD *
// SPACE=(CYL,1),DISP=(&STA,&DSP) COBOL program here
//LINK EXEC PGM=IEWBLINK
//SYSPRINT DD SYSOUT=A //SYSLIN DD DSN=OBJFILE,
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1) // DISP=(OLD,DELETE)
//SYSLIN DD DDNAME=SYSIN //SYSLMOD DD DSN=LOADLIB(PROG1)
//SYSLMOD DD DSN=LOADLIB(&PROG),DISP=SHR
*The Expanded Procedure
Let's take a look at a portion of the job listing for the previous example.
The next screen shows only the expanded procedure. Note that each statement is displayed on a single line, rather than several short lines (like the example).
*Identifying overrides
As you review the statements, remember that overrides appear with //, while overridden statements display with X/. Let's consider the COMPLINK procedure again and see if you can apply the facts you've seen.
XXCOB EXEC PGM=IGYCRCTL
//COB.SYSUT1 DD SPACE=(CYL,2)
X/SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1)
:
XXSYSUT7 DD UNIT=SYSDA,SPACE=(CYL,1)
XXSYSPRINT DD SYSOUT=A
//SYSLIN DD DSN=OBJFILE,UNIT=3350,SPACE=(CYL,(1,1)),VOL=SER=DISK01
X/SYSLIN DD DSN=&OBJECT,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,&DSP)
//SYSIN DD *
XXLINK EXEC PGM=IEWBLINK
XXSYSPRINT DD SYSOUT=A
//LINK.SYSUT1 DD SPACE=(CYL,3)
X/SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1)
//SYSLIN DD DSN=OBJFILE,DISP=(OLD,DELETE)
X/SYSLIN DD DDNAME=SYSIN
//SYSLMOD DD DSN=LOADLIB(PROG1)
X/SYSLMOD DD DSN=LOADLIB(&PROG),DISP=SHR
Topic 4.1: Unit 4 Summary
The following points were covered in this unit:- When you use multi-step procedures, you have an additional piece of information to supply with your override. You must indicate the step of the procedure that the override belongs in.
- Qualify overrides with procstepname.ddname to specify the PROC step where the DD statement belongs.
- Multi-step overrides must be in PROC step order.
- If you omit the ddname qualifier (procstepname.), the DD statement will be used with the first step in the procedure.
- Unqualified ddnames that follow a qualified ddname override are applied to the same step as the qualified ddname.
Unit 5. Parameter Overrides
This unit addresses the ways and means of modifying keyword parameters on EXEC statements for procedures.
Specifically, you'll study TIME, COND, REGION and PARM parameters.
After completing this unit, you should be able to:
- Describe terms and concepts related to parameter overrides
- Use unqualified parameter overrides
Topic 5.1: Overview
*A Little ClarificationBefore you jump into all the details, however, a few concepts and terms need to be clarified. That's the focus of this unit.
Let's start by considering keyword parameters.
*Order of Keyword Overrides
Following the procedure name parameter on the EXEC statement, you can have various keyword parameter overrides and / or symbolic parameter assignments. An EXEC statement for a procedure might look like this.
The order of the keyword parameter overrides and the symbolic parameter assignments does not matter. They may be mixed any way you like.
*Keyword Parameter Overrides
The keyword parameters you will see overridden in this unit are:
- COND
- PARM
- REGION
- TIME
*Override Formats and Effects
You've seen how the EXEC statement is coded to include keyword parameter overrides.
Now, let's consider the formats and effects these overrides have.
*Qualified and Unqualified Overrides
To override keyword parameters, you may code either of these two formats:
qualified - or - unqualified.
Qualified overrides specify the step name that the override applies to.
Unqualified overrides apply to the entire procedure.
*So...
EXEC statement parameters combine concepts that you learned about for both symbolic parameter assignments and DD statement overrides.
Additionally, when using unqualified EXEC parameter overrides, the overridden parameter determines how the value is applied.
Let's see exactly what this means.
*Parameters Applied to an Entire Job
You may remember from prior JCL experience that some parameters like COND and REGION can apply to the entire job or just to a particular step within the job.
Where (JOB or EXEC) and what you code for these parameters have various effects on the entire job's processing.
*An Example
There's a similar situation with these parameters in multi-step procedures.
For example, if overrides are coded without qualification:
COND and REGION | apply the same value to each step of a procedure |
PARM | applies the value to the first step only |
TIME | specifies a cumulative value for the entire procedure and nullifies each step's value |
*Qualifying a Keyword Override
To qualify a keyword parameter override, use this format:
keyword.procstepname=value
Without the .procstepname suffix, the override is unqualified.
Question 57
*Symbolic and Keyword Parameters
Let's look at one last point before you go on to the objective on qualified overrides for keyword parameters.
The point deals with symbolic parameters and keyword parameters.
//PROC7 PROC DATE='01/01',REPORT=FISC
//PRG1 EXEC PGM=PRG1,PARM=&DATE,REGION=60K
//PRG2 EXEC PGM=PRG2,COND=(8,EQ)
//PRG3 EXEC PGM=PRG3,TIME=(,20),PARM=&REPORT
//PRINT DD SYSOUT=A
// EXEC PROC7,COND.PRG2=(4,LT),TIME.PRG3=1,DATE='02/10',REPORT=MON
*Another Example
Shown here is an example of a procedure and its EXEC statement. It shows again that keyword parameter overrides and symbolic parameter assignments may be mixed.
The parameters are:
Keyword | Symbolic |
---|---|
COND in step PRG2 | DATE |
TIME in step PRG3 | REPORT |
//PROC7 PROC DATE='01/01',REPORT=FISC
//PRG1 EXEC PGM=PRG1,PARM=&DATE,REGION=60K
//PRG2 EXEC PGM=PRG2,COND=(8,EQ)
//PRG3 EXEC PGM=PRG3,TIME=(,20),PARM=&REPORT
//PRINT DD SYSOUT=A
// EXEC PROC7,COND.PRG2=(4,LT),TIME.PRG3=1,DATE='02/10',REPORT=MON
*An Important Point
Avoid giving a symbolic parameter the same name as a keyword parameter!
Let's modify the example and see what happens.
//PROC7 PROC DATE='01/01',REPORT=FISC
//PRG1 EXEC PGM=PRG1,PARM=&DATE,REGION=60K
//PRG2 EXEC PGM=PRG2,COND=(8,EQ)
//PRG3 EXEC PGM=PRG3,TIME=(,20),PARM=&REPORT
// EXEC PROC7,COND.PRG2=(4,LT),TIME.PRG3=1,DATE='02/10',REPORT=MON
*Symbolic Parameter
The example now has a symbolic parameter for the SYSOUT value on the PRINT DD in the third step -- it's TIME.
The name TIME for a symbolic parameter is going to cause problems!
The EXEC statement assignment is interpreted as the keyword parameter TIME. You have no way to assign a value to the symbolic parameter TIME.
The result is a JCL error!
*The Main Topics
So, the topics to cover about modifying parameters on an EXEC statement are...
- Qualified overrides
- Unqualified overrides
Topic 5.2: Qualified Overrides
*Qualified OverridesThe first objective defined a qualified override for a keyword parameter as having the format
keyword.procstepname=value
In this objective, you'll learn about using qualified overrides on an EXEC statement. You should notice a similarity to overriding a procedure's DD statements!
Let's get started.
*The Suffix .procstepname
You can override or assign a keyword parameter of a specific step in a procedure by including the suffix .procstepname.
For example: PARM.STEP3='R,03' overrides the PARM parameter for the procedure step named STEP3.
//PROC9 PROC
//STA EXEC PGM=PROGA,TIME=1,COND=(4,LE)
: DD statements
//STB EXEC PGM=PROGB,REGION=60K,PARM=ABCD
: DD statements
//STC EXEC PGM=PROGC
*A Sample Procedure
Consider this sample procedure. It has three steps:
- STA executes program PROGA and has keyword parameters TIME and COND set
- STB executes program PROGB and uses keyword parameters REGION and PARM
- STC executes program PROGC without any keyword parameters
Note: DD statements are not necessary for this example, thus they are not shown.
//PROC9 PROC
//STA EXEC PGM=PROGA,TIME=1,COND=(4,LE)
: DD statements
//STB EXEC PGM=PROGB,REGION=60K,PARM=ABCD
: DD statements
//STC EXEC PGM=PROGC
// EXEC PROC9,TIME.STA=(,40),REGION.STB=70K,PARM.STB=EFGHI,PARM.STC=XYZ
*An EXEC Statement
Shown here is an EXEC statement for this procedure.
Review the overrides on the EXEC, then go on and answer a question or two about them.
//PROC9 PROC
//STA EXEC PGM=PROGA,TIME=1,COND=(4,LE)
: DD statements
//STB EXEC PGM=PROGB,REGION=60K,PARM=ABCD
: DD statements
//STC EXEC PGM=PROGC
// EXEC PROC9,TIME.STA=(,40),REGION.STB=70K,PARM.STB=EFGHI,PARM.STC=XYZ
*The Order of Steps
You may have noticed that the overrides on this EXEC statement are ordered by steps within the procedure.
This is not just for convenience -- it is a rule you must follow.
*Maintaining the Order
Keyword parameter overrides must be in the same order as the procedure steps.
Thus, any overrides for the first step must come before any overrides for the second step, and so on.
Let's look at another example.
*Another Procedure
Here is another procedure and its associated EXEC statement.
Spend a moment sorting out its keyword and symbolic parameters.
//PROC2 PROC SYSOUT=A,DSP=DELETE
//STEP1 EXEC PGM=EDIT1
//SYSPRINT DD SYSOUT=&SYSOUT
//STEP2 EXEC PGM=EDIT2
//SYSLIST DD UNIT=DISK,SPACE=(TRK,1),DISP=(NEW,&DSP)
//STEP3 EXEC PGM=EDIT3
//SYSPRINT DD SYSOUT=&SYSOUT
// EXEC PROC2,PARM.STEP3=ABCD,SYSOUT=A,REGION.STEP1=40K,
// COND.STEP2=(4,LT),DSP=PASS
*Two Choices
// EXEC PROC2,REGION.STEP1=40K,SYSOUT=A,COND.STEP2=(4,LT),
// PARM.STEP3=ABCD,DSP=PASS
The first choice is valid:
- Keyword parameter overrides are in procedure step order
- Symbolic parameter overrides may be mixed this way
// COND.STEP2=(4,LT),DSP=PASS
The second is invalid:
- Overrides on the first line are in order, but COND.STEP2 needs to go between the other two
*A Third Choice
// EXEC PROC2,REGION.STEP1=40K,COND.STEP2=(4,LT),
// PARM.STEP3=ABCD,SYSOUT=A,DSP=PASS
The third choice is valid and a recommended coding practice.
Here the types of overrides are grouped together to make the coding clearer. The order of the groups -- keyword then symbolic, or symbolic then keyword -- is immaterial!
*Invalid EXEC Format
You may be wondering what happens if you leave the EXEC statement in its invalid format...
// EXEC PROC2,PARM.STEP3=ABCD,SYSOUT=A,REGION.STEP1=40K,
// COND.STEP2=(4,LT),DSP=PASS
Let's find out by checking the job listing that would be created from a run with it.
1 //TESTRUN JOB ....
2 // EXEC PROC2,PARM.STEP3=ABCD,SYSOUT=A,REGION.STEP1=40K,
// COND.STEP2=(4,LT),DSP=PASS
3 XXPROC2 PROC SYSOUT=A,DSP=DELETE
4 XXSTEP1 EXEC PGM=EDIT1
5 XXSYSPRINT DD SYSOUT=&SYSOUT
6 XXSTEP2 EXEC PGM=EDIT2
7 XXSYSLIST DD UNIT=DISK,SPACE=(TRK,1),DISP=(NEW,&DSP)
8 XXSTEP3 EXEC PGM=EDIT3
9 XXSYSPRINT DD SYSOUT=&SYSOUT
*The Listing
Here you see how the procedure expands and prints in the listing.
Now the information from the next page of the listing...
1 //TESTRUN JOB ....
2 // EXEC PROC2,PARM.STEP3=ABCD,SYSOUT=A,REGION.STEP1=40K,
// COND.STEP2=(4,LT),DSP=PASS
3 XXPROC2 PROC SYSOUT=A,DSP=DELETE
4 XXSTEP1 EXEC PGM=EDIT1
5 XXSYSPRINT DD SYSOUT=&SYSOUT
6 XXSTEP2 EXEC PGM=EDIT2
7 XXSYSLIST DD UNIT=DISK,SPACE=(TRK,1),DISP=(NEW,&DSP)
8 XXSTEP3 EXEC PGM=EDIT3
9 XXSYSPRINT DD SYSOUT=&SYSOUT
*System Messages
Here are the system messages for the run. The last one, of course, is a JCL error.
STMT NO. MESSAGE
5 IEF653I SUBSTITUTION JCL - SYSOUT=A
7 IEF653I SUBSTITUTION JCL - UNIT=DISK,
SPACE=(TRK,1),DISP=(NEW,PASS)
9 IEF653I SUBSTITUTION JCL - SYSOUT=A
2 IEF611I OVERRIDDEN STEP NOT FOUND IN
PROCEDURE
Question 66
*Differences to Bear in Mind
Though similar to modifying DD statements of a procedure, modifying keyword parameters has two major differences.
First, to modify a keyword parameter you code keyword.procstepname and with the DD statements it's procstepname.ddname.
Second, the effect of omitting the suffix on the keyword override is not the same as omitting the prefix on the DD.
Now you can try your hand at coding a few overrides.
Topic 5.3: Unit 5 Summary
The following points were covered in this unit:- Following the procedure name parameter on the EXEC statement, you can have various keyword parameter overrides and/or symbolic parameter assignments.
- To override keyword parameters, you may code either of these two formats: qualified or unqualified.
- When using unqualified EXEC parameter overrides, the overridden parameter determines how the value is applied.
- To qualify a keyword parameter override, use this format: keyword.procstepname=value.
- Keyword parameter overrides and symbolic parameter assignments may be mixed.
- It's important to avoid giving a symbolic parameter the same name as a keyword parameter.
- You can override or assign a keyword parameter of a specific step in a procedure by including the suffix .procstepname.
- Keyword parameter overrides must be in the same order as the procedure steps.
- A recommended coding practice is grouping similar types of overrides together on the EXEC statement. For example, code all keyword parameters followed by all symbolic parameters.
- A JCL error occurs for keyword parameter overrides that are not in order. The system will fail to find the overridden step since it does not look at steps skipped.
Unit 6. Modifying Other Parameters
In this unit, we briefly consider overrides that do not use the .procstepname suffix.
The keyword parameters you'll see -- COND, PARM, REGION and TIME -- are the same, however.
After completing this unit, you should be able to:
- Use unqualified overrides
- Apply modified EXEC statements
Topic 6.1: Unqualified Parameter Overrides
*Specifying Unqualified ParametersWhen you specify an unqualified keyword parameter on a procedure's EXEC statement, the value generally applies to the entire procedure.
For example: REGION=256K assigns 256K to all the steps of the procedure.
*An Example
The value that the unqualified keyword parameter assigns, however, depends on the parameter being overridden.
For example:
COND and REGION | apply the same value to each step of a procedure |
PARM | applies the value only to the first step and nullifies all following steps |
TIME | specifies a cumulative value for the entire procedure and nullifies each step's value |
//PROCONE PROC
//ST1 EXEC PGM=PROG1,REGION=40K
: DD statements
//ST2 EXEC PGM=PROG2,REGION=90K
: DD statements
//ST3 EXEC PGM=PROG3,REGION=128K
*A Sample Procedure
This sample procedure has three steps -- ST1, ST2 and ST3.
Each step specifies its own values for keyword parameters.
This example (and all in this objective) do not show the DD statements associated with the procedure steps. They are not necessary for the purpose of the example.
//PROCONE PROC
//ST1 EXEC PGM=PROG1,REGION=40K
: DD statements
//ST2 EXEC PGM=PROG2,REGION=90K
: DD statements
//ST3 EXEC PGM=PROG3,REGION=128K
*A Possible EXEC Statement
Here you see one possible EXEC statement for this procedure.
This one changes the values specified on each step to the value assigned on the EXEC statement.
Each step will use the value of 100K for REGION
*The TIME Override
The previous examples showed...
- An unqualified REGION override assigns the same value to each step of the procedure.
- Different values specified in a step are overridden.
- Most keyword parameters work this way, but two -- PARM and TIME -- do not.
- An unqualified PARM override affects only the first step of the procedure.
- An unqualified TIME override has a cumulative effect.
*The Time Override
TIME has a cumulative effect on a procedure.
This parameter specifies the CPU time that the entire procedure execution should not exceed. It is a time limit that is imposed on the procedure as a whole.
Specifying TIME on the procedure's EXEC statement nullifies the TIME specified on the individual procedure steps.
//PROCSIX PROC
//ST1 EXEC PGM=PROG1,TIME=(,30)
: DD statements
//ST2 EXEC PGM=PROG2,TIME=1
: DD statements
//ST3 EXEC PGM=PROG3,TIME=(1,10)
// EXEC PROCSIX,TIME=1
*An Example
Here is an example procedure and EXEC statement to clarify the TIME parameter.
The original procedure sets the CPU time limits as follows:
- ST1 - 30 seconds
- ST2 - 1 minute
- ST3 - 1 minute and 10 seconds
//PROCSIX PROC
//ST1 EXEC PGM=PROG1,TIME=(,30)
: DD statements
//ST2 EXEC PGM=PROG2,TIME=1
: DD statements
//ST3 EXEC PGM=PROG3,TIME=(1,10)
// EXEC PROCSIX,TIME=1
ST1
No matter how little time ST1 uses, there will be less than 1 minute left for the following two steps. ST2 and ST3 will never be able to execute to their upper time limits as originally coded.
Since the TIME parameter nullifies the original limits coded on the steps, ST1 could use the entire minute! It's no longer limited to 30 seconds.
//PROCSIX PROC
//ST1 EXEC PGM=PROG1,TIME=(,30)
: DD statements
//ST2 EXEC PGM=PROG2,TIME=1
: DD statements
//ST3 EXEC PGM=PROG3,TIME=(1,10)
// EXEC PROCSIX,TIME=(,45)
*Review for a Moment
Note the new EXEC statement shown here. Review it for a bit and then go on to answer a few questions.
//PROCSIX PROC
//ST1 EXEC PGM=PROG1,TIME=(,30)
: DD statements
//ST2 EXEC PGM=PROG2,TIME=1
: DD statements
//ST3 EXEC PGM=PROG3,TIME=(1,10)
// EXEC PROCSIX,TIME=(,45)
*In fact...
whenever 45 seconds of CPU time is used up, the remaining steps will fail.
The TIME override on the EXEC statement sets the limit for this procedure.
Topic 6.2: Applications
COMPILE and COMPLINKThe earlier parts of this unit covered a variety of details about modifying parameters on EXEC statements.
Now let's look again at the cataloged procedures COMPILE and COMPLINK to see how some of these details can be applied.
//COMPILE PROC OBJ=LOADSET,SYSOUT=A,STA=NEW
//COMP EXEC PGM=IGYCRCTL,PARM='LIB,PMAP,DMAP',COND=(8,LE)
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,2)
//SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,2)
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,2)
//SYSPRINT DD SYSOUT=&SYSOUT
//SYSLIN DD DSN=&OBJ,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,PASS)
//SYSLIB DD DSN=MY.COPYLIB,DISP=SHR
*The COMPILE Procedure
Here you see a variation of the COMPILE procedure developed in previous units of this course.
Study it for a minute -- be sure to note its keyword and symbolic parameters.
//COMPILE PROC OBJ=LOADSET,SYSOUT=A,STA=NEW
//COMP EXEC PGM=IGYCRCTL,PARM='LIB,PMAP,DMAP',COND=(8,LE)
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,2)
//SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,2)
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,2)
//SYSPRINT DD
//SYSLIN DD ,UNIT=SYSDA,SPACE=(CYL,1),
//SYSLIB DD DSN=MY.COPYLIB,DISP=SHR
OBJ, SYSOUT, and STA
OBJ -- the name to be assigned to the data set that will contain the object module (default is LOADSET)
SYSOUT -- the output class for the printout (default is A).
STA -- the status of the object module data set (default is NEW).
//COMPILE PROC OBJ=LOADSET,SYSOUT=A,STA=NEW
//COMP EXEC PGM=IGYCRCTL,
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,2)
//SYSUT2 DD UNIT=SYSDA,SPACE=(CYL,2)
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,2)
//SYSPRINT DD SYSOUT=&SYSOUT
//SYSLIN DD DSN=&OBJ,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,PASS)
//SYSLIB DD DSN=MY.COPYLIB,DISP=SHR
*Finishing With COMPILE
You should be familiar with the COND parameter from your previous JCL experience.
The PARM parameter here:
- Tells the COBOL compiler to look for a SYSLIB DD statement in the JCL -- LIB
- Indicates that a compiler procedure map and data map are to be included with the program listing -- PMAP,DMAP.
//COMPLINK PROC OBJ=LOADSET,SYSOUT=A,STA=NEW,MEM=TEMPNAME
//COMP EXEC PGM=IGYCRCTL,PARM='LIB,PMAP,DMAP',COND=(8,LE)
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,2)
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,2)
//SYSPRINT DD SYSOUT=&SYSOUT
//SYSLIN DD DSN=&OBJ,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,PASS)
//SYSLIB DD DSN=MY.COPYLIB,DISP=SHR
//LINK EXEC PGM=IEWBLINK,PARM=XREF,COND=(8,LE,COMP)
//SYSPRINT DD SYSOUT=&SYSOUT
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1)
//SYSLMOD DD DSN=&LIB(&MEM),DISP=SHR
//SYSLIB DD DSN=SYS1.COBLIB,DISP=SHR
// DD DSN=&LIB,DISP=SHR
//SYSLIN DD DSN=&OBJ,DISP=(OLD,DELETE)
COMPLINK
This variation of the COMPLINK procedure combines the COMPILE procedure you just saw with a bind step.
Note again the symbolic and keyword parameters used here.
//COMPLINK PROC OBJ=LOADSET,SYSOUT=A,STA=NEW,MEM=TEMPNAME
//COMP EXEC PGM=IGYCRCTL,PARM='LIB,PMAP,DMAP',COND=(8,LE)
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,2)
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,2)
//SYSPRINT DD SYSOUT=&SYSOUT
//SYSLIN DD DSN=&OBJ,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,PASS)
//SYSLIB DD DSN=MY.COPYLIB,DISP=SHR
//LINK EXEC PGM=IEWBLINK,PARM=XREF,COND=(8,LE,COMP)
//SYSPRINT DD SYSOUT=&SYSOUT
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1)
//SYSLMOD DD DSN=&LIB(&MEM),DISP=SHR
//SYSLIB DD DSN=SYS1.COBLIB,DISP=SHR
// DD DSN=&LIB,DISP=SHR
//SYSLIN DD DSN=&OBJ,DISP=(OLD,DELETE)
COMPLINK Symbolic Parameters
The additional symbolic parameters for COMPLINK are: LIB -- the name of the program library which receives the program (default is unassigned) MEM -- the member name to be assigned to the program when it becomes a member of the program library (default is TEMPNAME)
//COMPLINK PROC OBJ=LOADSET,SYSOUT=A,STA=NEW,MEM=TEMPNAME
//COMP EXEC PGM=IGYCRCTL,PARM='LIB,PMAP,DMAP',COND=(8,LE)
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,2)
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,2)
//SYSPRINT DD SYSOUT=&SYSOUT
//SYSLIN DD DSN=&OBJ,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,PASS)
//LINK EXEC PGM=IEWBLINK,PARM=XREF,COND=(8,LE,COMP)
//SYSPRINT DD SYSOUT=&SYSOUT
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1)
//SYSLMOD DD DSN=&LIB(&MEM),DISP=SHR
//SYSLIN DD DSN=&OBJ,DISP=(OLD,DELETE)
SYSLIB DD
Note the two SYSLIB DD statements.
The one in COMP specifies the source library to search when a COPY statement is encountered in the COBOL program.
//COMPLINK PROC OBJ=LOADSET,SYSOUT=A,STA=NEW,MEM=TEMPNAME
//COMP EXEC PGM=IGYCRCTL,PARM='LIB,PMAP,DMAP',COND=(8,LE)
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,2)
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,2)
//SYSPRINT DD SYSOUT=&SYSOUT
//SYSLIN DD DSN=&OBJ,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,PASS)
//LINK EXEC PGM=IEWBLINK,PARM=XREF,COND=(8,LE,COMP)
//SYSPRINT DD SYSOUT=&SYSOUT
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1)
//SYSLMOD DD DSN=&LIB(&MEM),DISP=SHR
//SYSLIN DD DSN=&OBJ,DISP=(OLD,DELETE)
*The LINK Step
Note the two SYSLIB DD statements.
The LINK step's SYSLIB defines two libraries to search for subroutines used in the COBOL program. The libraries are concatenated so that SYS1.COBLIB is searched first and then the library specified by the symbolic parameter LIB.
//COMPLINK PROC OBJ=LOADSET,SYSOUT=A,STA=NEW,MEM=TEMPNAME
//COMP EXEC PGM=IGYCRCTL,PARM='LIB,PMAP,DMAP',COND=(8,LE)
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,2)
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,2)
//SYSPRINT DD SYSOUT=&SYSOUT
//SYSLIN DD DSN=&OBJ,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,PASS)
//SYSLIB DD DSN=MY.COPYLIB,DISP=SHR
//LINK EXEC PGM=IEWBLINK,,COND=(8,LE,COMP)
//SYSPRINT DD SYSOUT=&SYSOUT
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1)
//SYSLMOD DD DSN=&LIB(&MEM),DISP=SHR
//SYSLIB DD DSN=SYS1.COBLIB,DISP=SHR
// DD DSN=&LIB,DISP=SHR
//SYSLIN DD DSN=&OBJ,DISP=(OLD,DELETE)
*The XREF Value
The PARM parameter for the LINK step uses the value XREF.
This specifies to the binder that a cross reference listing is to be produced. The listing shows the names and offsets of the subroutines that were linked with the program.
*Executing COMPLINK
Now you know how COMPILE and COMPLINK are set up with their various symbolic and keyword parameters.
Let's consider how you might want to execute the COMPLINK procedure...
...and determine the overrides you need on the procedure EXEC statement.
//COMPLINK PROC OBJ=LOADSET,SYSOUT=A,STA=NEW,MEM=TEMPNAME
//COMP EXEC PGM=IGYCRCTL,PARM='LIB,PMAP,DMAP',COND=(8,LE)
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,2)
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,2)
//SYSPRINT DD SYSOUT=&SYSOUT
//SYSLIN DD DSN=&OBJ,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,PASS)
//SYSLIB DD DSN=MY.COPYLIB,DISP=SHR
//LINK EXEC PGM=IEWBLINK,PARM=XREF,COND=(8,LE,COMP)
//SYSPRINT DD SYSOUT=&SYSOUT
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1)
//SYSLMOD DD DSN=&LIB(&MEM),DISP=SHR
//SYSLIB DD DSN=SYS1.COBLIB,DISP=SHR
// DD DSN=&LIB,DISP=SHR
//SYSLIN DD DSN=&OBJ,DISP=(OLD,DELETE)
NOLIB
Suppose you want to compile and link a COBOL program that does not use COPY statements. Thus, NOLIB must replace LIB in the PARM value for the compiler. Furthermore, you don't need XREF for the LINK step.
//COMPLINK PROC OBJ=LOADSET,SYSOUT=A,STA=NEW,MEM=TEMPNAME
//COMP EXEC PGM=IGYCRCTL,PARM='LIB,PMAP,DMAP',COND=(8,LE)
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,2)
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,2)
//SYSPRINT DD SYSOUT=&SYSOUT
//SYSLIN DD DSN=&OBJ,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,PASS)
//SYSLIB DD DSN=MY.COPYLIB,DISP=SHR
//LINK EXEC PGM=IEWBLINK,PARM=XREF,COND=(8,LE,COMP)
//SYSPRINT DD SYSOUT=&SYSOUT
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1)
//SYSLMOD DD DSN=&LIB(&MEM),DISP=SHR
//SYSLIB DD DSN=SYS1.COBLIB,DISP=SHR
// DD DSN=&LIB,DISP=SHR
//SYSLIN DD DSN=&OBJ,DISP=(OLD,DELETE)
*Naming the Program
You also want to name the program MYPGM1 and place it in the program library COB.TESTLIB.
The region for the binder must be specified as 2M.
//COMPLINK PROC OBJ=LOADSET,SYSOUT=A,STA=NEW,MEM=TEMPNAME
//COMP EXEC PGM=IGYCRCTL,PARM='LIB,PMAP,DMAP',COND=(8,LE)
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,2)
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,2)
//SYSPRINT DD SYSOUT=&SYSOUT
//SYSLIN DD DSN=&OBJ,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,PASS)
//SYSLIB DD DSN=MY.COPYLIB,DISP=SHR
//LINK EXEC PGM=IEWBLINK,PARM=XREF,COND=(8,LE,COMP)
//SYSPRINT DD SYSOUT=&SYSOUT
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1)
//SYSLMOD DD DSN=&LIB(&MEM),DISP=SHR
//SYSLIB DD DSN=SYS1.COBLIB,DISP=SHR
// DD DSN=&LIB,DISP=SHR
//SYSLIN DD DSN=&OBJ,DISP=(OLD,DELETE)
*Nullifying the PARM Value
In order to remove the XREF option from the LINK step, you must nullify the PARM value for that step. One way to do this is to follow the equal sign on PARM.LINK with no value.
//COMPLINK PROC OBJ=LOADSET,SYSOUT=A,STA=NEW,MEM=TEMPNAME
//COMP EXEC PGM=IGYCRCTL,PARM='LIB,PMAP,DMAP',COND=(8,LE)
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,2)
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,2)
//SYSPRINT DD SYSOUT=&SYSOUT
//SYSLIN DD DSN=&OBJ,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,PASS)
//SYSLIB DD DSN=MY.COPYLIB,DISP=SHR
//LINK EXEC PGM=IEWBLINK,PARM=XREF,COND=(8,LE,COMP)
//SYSPRINT DD SYSOUT=&SYSOUT
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1)
//SYSLMOD DD DSN=&LIB(&MEM),DISP=SHR
//SYSLIB DD DSN=SYS1.COBLIB,DISP=SHR
// DD DSN=&LIB,DISP=SHR
//SYSLIN DD DSN=&OBJ,DISP=(OLD,DELETE)
*An Unqualified PARM Override
PARM.COMP='NOLIB,PMAP,DMAP',PARM.LINK= overrides each step individually -- specifies the NULL value for the LINK step. PARM='NOLIB,PMAP,DMAP' uses the nature of an unqualified PARM override -- assigns value to the first step and nullifies all following steps.
//COMPLINK PROC OBJ=LOADSET,SYSOUT=A,STA=NEW,MEM=TEMPNAME
//COMP EXEC PGM=IGYCRCTL,PARM='LIB,PMAP,DMAP',COND=(8,LE)
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,2)
:
//SYSUT7 DD UNIT=SYSDA,SPACE=(CYL,2)
//SYSPRINT DD SYSOUT=&SYSOUT
//SYSLIN DD DSN=&OBJ,UNIT=SYSDA,SPACE=(CYL,1),DISP=(&STA,PASS)
//SYSLIB DD DSN=MY.COPYLIB,DISP=SHR
//LINK EXEC PGM=IEWBLINK,PARM=XREF,COND=(8,LE,COMP)
//SYSPRINT DD SYSOUT=&SYSOUT
//SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,1)
//SYSLMOD DD DSN=&LIB(&MEM),DISP=SHR
//SYSLIB DD DSN=SYS1.COBLIB,DISP=SHR
// DD DSN=&LIB,DISP=SHR
//SYSLIN DD DSN=&OBJ,DISP=(OLD,DELETE)
*The EXEC Statement
// EXEC COMPLINK,LIB='COB.TESTLIB',MEM=MYPGM1,
// PARM='NOLIB,PMAP,DMAP',REGION.LINK=2M
This EXEC statement accomplishes all the desired results:
- Replacing LIB for COMP and removing XREF in LINK
- Creating MYPGM1 in COB.TESTLIB
- Allocating 2M for LINK
*Added Flexibility
Procedures such as COMPILE and COMPLINK have many possible applications! Modifying parameters on the EXEC statement adds to the flexibility of procedures.
Topic 6.3: Unit 6 Summary
The following points were covered in this unit:1. When you specify an unqualified keyword parameter on a procedure's EXEC statement, the value generally applies to the entire procedure.
2. The value that the unqualified keyword parameter assigns, however, depends on the parameter being overridden.
3. An unqualified REGION override assigns the same value to each step of the procedure.
4. An unqualified PARM override affects only the first step of the procedure.
5. An unqualified TIME override has a cumulative effect.