Top Banner
JCL Chapter c1 Nested procedures
26

JCL - mirror.vpsfree.cz · Job Control Language Chapter b1. Using special DD statements Chapter b2. Introducing procedures Chapter b3. Modifying EXEC parameters Chapter b4. Modifying

Aug 17, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: JCL - mirror.vpsfree.cz · Job Control Language Chapter b1. Using special DD statements Chapter b2. Introducing procedures Chapter b3. Modifying EXEC parameters Chapter b4. Modifying

JCL

Chapter c1Nested procedures

Page 2: JCL - mirror.vpsfree.cz · Job Control Language Chapter b1. Using special DD statements Chapter b2. Introducing procedures Chapter b3. Modifying EXEC parameters Chapter b4. Modifying

Copyright © 2006 CA. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Job Control Language

Chapter a1. Introduction to JCL

Chapter a2. Coding JOB statements

Chapter a3. Coding EXEC statements

Chapter a4. Coding DD statements

Chapter a5. Analyzing job output

Chapter a6. Conditional processing

Page 3: JCL - mirror.vpsfree.cz · Job Control Language Chapter b1. Using special DD statements Chapter b2. Introducing procedures Chapter b3. Modifying EXEC parameters Chapter b4. Modifying

Copyright © 2006 CA. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Job Control Language

Chapter b1. Using special DD statements

Chapter b2. Introducing procedures

Chapter b3. Modifying EXEC parameters

Chapter b4. Modifying DD parameters

Chapter b5. Determining the effective JCL

Chapter b6. Symbolic parameters

Page 4: JCL - mirror.vpsfree.cz · Job Control Language Chapter b1. Using special DD statements Chapter b2. Introducing procedures Chapter b3. Modifying EXEC parameters Chapter b4. Modifying

Copyright © 2006 CA. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Job Control Language

Chapter c1. Nested procedures

Chapter c2. Cataloging procedures.

Chapter c3. Using utility programs

Chapter c4. Sample utility application

Page 5: JCL - mirror.vpsfree.cz · Job Control Language Chapter b1. Using special DD statements Chapter b2. Introducing procedures Chapter b3. Modifying EXEC parameters Chapter b4. Modifying

Copyright © 2006 CA. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Nested procedures.

Chapter c1

Nested procedures

Page 6: JCL - mirror.vpsfree.cz · Job Control Language Chapter b1. Using special DD statements Chapter b2. Introducing procedures Chapter b3. Modifying EXEC parameters Chapter b4. Modifying

Copyright © 2006 CA. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Nested procedures.

Unit introduction.

We will be able to code a statement to invoke and modify a nested procedure.

Page 7: JCL - mirror.vpsfree.cz · Job Control Language Chapter b1. Using special DD statements Chapter b2. Introducing procedures Chapter b3. Modifying EXEC parameters Chapter b4. Modifying

Copyright © 2006 CA. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Invoking nested procedures.

Nested procedure.

What is a nested procedure?

When procedures are nested, one procedure invokes another.

Nested procedure – an example:

There are three procedures:

PROCA

PROCB

PROCC

In the example on the right, there are three procedures:

PROCA, PROCB, and PROCC.

PROCA invokes PROCB, and

PROCB invokes PROCC.

PROCA

//STEP1 EXEC PROCC

//STEP2 EXEC PGM=XYZ

//S1 EXEC PGM=KLM

//S2 EXEC PGM=RST

PROCC

PROCB

//PSTEP1 EXEC PGM=ABC

//PSTEP2 EXEC PROCB

Page 8: JCL - mirror.vpsfree.cz · Job Control Language Chapter b1. Using special DD statements Chapter b2. Introducing procedures Chapter b3. Modifying EXEC parameters Chapter b4. Modifying

Copyright © 2006 CA. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Invoking nested procedures.

Coding overrides and additions.

Procedures can be nested up to 15 levels.

Changes to nested procedures can be complex, since you can only override a procedure at the point where it is called. In the example on the right, PROCA can override PROCB on its //PSTEP2 EXEC.

//PSTEP1 EXEC PGM=ABC

//PSTEP2 EXEC PROCB

OVERRIDEsOVERRIDEs

//STEP1 EXEC PROCC

//STEP2 EXEC PGM=XYZ

//S1 EXEC PGM=KLM

//S2 EXEC PGM=RST

PROCA

PROCC

PROCB

Page 9: JCL - mirror.vpsfree.cz · Job Control Language Chapter b1. Using special DD statements Chapter b2. Introducing procedures Chapter b3. Modifying EXEC parameters Chapter b4. Modifying

Copyright © 2006 CA. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Invoking nested procedures.

Coding overrides and additions – an example.

Assume PROCA and PROCB have the JCL shown. Note that PROCA invokes PROCB.

You want to add an addition statement with a DDname of DD1 to both procedures.

PROC A://PROCA PROC//PROCA1 EXEC PGM=IEFBR14//OUT DSN=KOTMI01.TEST.AAA,...//PROCA2 EXEC PROCB

PROC B://PROCB PROC//PROCB1 EXEC PGM=IEFBR14//OUT DSN=KOTMI01.TEST.BBB,...

Page 10: JCL - mirror.vpsfree.cz · Job Control Language Chapter b1. Using special DD statements Chapter b2. Introducing procedures Chapter b3. Modifying EXEC parameters Chapter b4. Modifying

Copyright © 2006 CA. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Invoking nested procedures.

Coding overrides and additions – an example.

To include an addition statement while invoking PROCA, the job which invokes PROCA needs to be modified as shown on the right.

//KOTMNEST JOB ...//PROCLIB JCLLIB ORDER=...//CALLA EXEC PROCA//PROCA1.DD1 DD DSN=KOTMI01.AAA, // ...

Page 11: JCL - mirror.vpsfree.cz · Job Control Language Chapter b1. Using special DD statements Chapter b2. Introducing procedures Chapter b3. Modifying EXEC parameters Chapter b4. Modifying

Copyright © 2006 CA. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Invoking nested procedures.

Coding overrides and additions – an example.

To include an addition statement while invoking PROCB, the procedure PROCA needs to be modified as shown on the right.

//PROCA PROC//PROCA1 EXEC PGM=IEFBR14//OUT DD DSN=KOTMI01.TEST.AAA, // ...//PROCA2 EXEC PROCB//PROCB1.DD1 DD DSN=KOTMI01.BBB, // ...

Page 12: JCL - mirror.vpsfree.cz · Job Control Language Chapter b1. Using special DD statements Chapter b2. Introducing procedures Chapter b3. Modifying EXEC parameters Chapter b4. Modifying

Copyright © 2006 CA. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Invoking nested procedures.

Are we on track?

Assume that you have procedures named PROC1 to PROC12 (nested up to 12 levels). You execute PROC3 with an override EXEC statement as follows:

//JSTEP EXEC PROC3,TIME=3

What is the effect of this override statement?

A. The specified TIME parameter applies to PROC1 through PROC3.

B. The specified TIME parameter applies to PROC3 through PROC12.

C. The specified TIME parameter applies to all procedures.

D. The specified TIME parameter applies to PROC3.

Page 13: JCL - mirror.vpsfree.cz · Job Control Language Chapter b1. Using special DD statements Chapter b2. Introducing procedures Chapter b3. Modifying EXEC parameters Chapter b4. Modifying

Copyright © 2006 CA. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Nested procedures.

Unit summary.

Now that you have completed this unit, you should be able to:

• Code a statement to invoke and modify a nested procedure.

Page 14: JCL - mirror.vpsfree.cz · Job Control Language Chapter b1. Using special DD statements Chapter b2. Introducing procedures Chapter b3. Modifying EXEC parameters Chapter b4. Modifying

1

JCL

Chapter c1Nested procedures

Page 15: JCL - mirror.vpsfree.cz · Job Control Language Chapter b1. Using special DD statements Chapter b2. Introducing procedures Chapter b3. Modifying EXEC parameters Chapter b4. Modifying

2 Copyright © 2006 CA. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Job Control Language

Chapter a1. Introduction to JCL

Chapter a2. Coding JOB statements

Chapter a3. Coding EXEC statements

Chapter a4. Coding DD statements

Chapter a5. Analyzing job output

Chapter a6. Conditional processing

Page 16: JCL - mirror.vpsfree.cz · Job Control Language Chapter b1. Using special DD statements Chapter b2. Introducing procedures Chapter b3. Modifying EXEC parameters Chapter b4. Modifying

3 Copyright © 2006 CA. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Job Control Language

Chapter b1. Using special DD statements

Chapter b2. Introducing procedures

Chapter b3. Modifying EXEC parameters

Chapter b4. Modifying DD parameters

Chapter b5. Determining the effective JCL

Chapter b6. Symbolic parameters

Page 17: JCL - mirror.vpsfree.cz · Job Control Language Chapter b1. Using special DD statements Chapter b2. Introducing procedures Chapter b3. Modifying EXEC parameters Chapter b4. Modifying

4 Copyright © 2006 CA. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Job Control Language

Chapter c1. Nested procedures

Chapter c2. Cataloging procedures.

Chapter c3. Using utility programs

Chapter c4. Sample utility application

Page 18: JCL - mirror.vpsfree.cz · Job Control Language Chapter b1. Using special DD statements Chapter b2. Introducing procedures Chapter b3. Modifying EXEC parameters Chapter b4. Modifying

5

5 Copyright © 2006 CA. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Nested procedures.

Chapter c1

Nested procedures

Page 19: JCL - mirror.vpsfree.cz · Job Control Language Chapter b1. Using special DD statements Chapter b2. Introducing procedures Chapter b3. Modifying EXEC parameters Chapter b4. Modifying

6

6 Copyright © 2006 CA. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Nested procedures.

Unit introduction.

We will be able to code a statement to invoke and modify a nested procedure.

Page 20: JCL - mirror.vpsfree.cz · Job Control Language Chapter b1. Using special DD statements Chapter b2. Introducing procedures Chapter b3. Modifying EXEC parameters Chapter b4. Modifying

7

7 Copyright © 2006 CA. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Invoking nested procedures.

Nested procedure.

What is a nested procedure?

When procedures are nested, one procedure invokes another.

Nested procedure – an example:

There are three procedures:

PROCA

PROCB

PROCC

In the example on the right, there are three procedures:

PROCA, PROCB, and PROCC.

PROCA invokes PROCB, and

PROCB invokes PROCC.

PROCA

//STEP1 EXEC PROCC

//STEP2 EXEC PGM=XYZ

//S1 EXEC PGM=KLM

//S2 EXEC PGM=RST

PROCC

PROCB

//PSTEP1 EXEC PGM=ABC

//PSTEP2 EXEC PROCB

Page 21: JCL - mirror.vpsfree.cz · Job Control Language Chapter b1. Using special DD statements Chapter b2. Introducing procedures Chapter b3. Modifying EXEC parameters Chapter b4. Modifying

8

8 Copyright © 2006 CA. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Invoking nested procedures.

Coding overrides and additions.

Procedures can be nested up to 15 levels.

Changes to nested procedures can be complex, since you can only override a procedure at the point where it is called. In the example on the right, PROCA can override PROCB on its //PSTEP2 EXEC.

//PSTEP1 EXEC PGM=ABC

//PSTEP2 EXEC PROCB

OVERRIDEsOVERRIDEs

//STEP1 EXEC PROCC

//STEP2 EXEC PGM=XYZ

//S1 EXEC PGM=KLM

//S2 EXEC PGM=RST

PROCA

PROCC

PROCB

Page 22: JCL - mirror.vpsfree.cz · Job Control Language Chapter b1. Using special DD statements Chapter b2. Introducing procedures Chapter b3. Modifying EXEC parameters Chapter b4. Modifying

9

9 Copyright © 2006 CA. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Invoking nested procedures.

Coding overrides and additions – an example.

Assume PROCA and PROCB have the JCL shown. Note that PROCA invokes PROCB.

You want to add an addition statement with a DDname of DD1 to both procedures.

PROC A://PROCA PROC//PROCA1 EXEC PGM=IEFBR14//OUT DSN=KOTMI01.TEST.AAA,...//PROCA2 EXEC PROCB

PROC B://PROCB PROC//PROCB1 EXEC PGM=IEFBR14//OUT DSN=KOTMI01.TEST.BBB,...

(PROCA and PROCB on this slide are different from PROCA and PROCB on previous slide.)

Page 23: JCL - mirror.vpsfree.cz · Job Control Language Chapter b1. Using special DD statements Chapter b2. Introducing procedures Chapter b3. Modifying EXEC parameters Chapter b4. Modifying

10

10 Copyright © 2006 CA. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Invoking nested procedures.

Coding overrides and additions – an example.

To include an addition statement while invoking PROCA, the job which invokes PROCA needs to be modified as shown on the right.

//KOTMNEST JOB ...//PROCLIB JCLLIB ORDER=...//CALLA EXEC PROCA//PROCA1.DD1 DD DSN=KOTMI01.AAA, // ...

Page 24: JCL - mirror.vpsfree.cz · Job Control Language Chapter b1. Using special DD statements Chapter b2. Introducing procedures Chapter b3. Modifying EXEC parameters Chapter b4. Modifying

11

11 Copyright © 2006 CA. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Invoking nested procedures.

Coding overrides and additions – an example.

To include an addition statement while invoking PROCB, the procedure PROCA needs to be modified as shown on the right.

//PROCA PROC//PROCA1 EXEC PGM=IEFBR14//OUT DD DSN=KOTMI01.TEST.AAA, // ...//PROCA2 EXEC PROCB//PROCB1.DD1 DD DSN=KOTMI01.BBB, // ...

In my opinion it has no meaning to modify nested procedures. Procedure should be written in its „crystalline“ form, we should not specify any modifications directly to the procedure specification.

See MCOE.EDU.JCL.JCL(PROCNEST) and MCOE.EDU.JCL.PROCLIB(PROCA, PROCB).

Page 25: JCL - mirror.vpsfree.cz · Job Control Language Chapter b1. Using special DD statements Chapter b2. Introducing procedures Chapter b3. Modifying EXEC parameters Chapter b4. Modifying

12

12 Copyright © 2006 CA. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Invoking nested procedures.

Are we on track?

Assume that you have procedures named PROC1 to PROC12 (nested up to 12 levels). You execute PROC3 with an override EXEC statement as follows:

//JSTEP EXEC PROC3,TIME=3

What is the effect of this override statement?

A. The specified TIME parameter applies to PROC1 through PROC3.

B. The specified TIME parameter applies to PROC3 through PROC12.

C. The specified TIME parameter applies to all procedures.

D. The specified TIME parameter applies to PROC3.

The correct answer is D.

Page 26: JCL - mirror.vpsfree.cz · Job Control Language Chapter b1. Using special DD statements Chapter b2. Introducing procedures Chapter b3. Modifying EXEC parameters Chapter b4. Modifying

13

13 Copyright © 2006 CA. All trademarks, trade names, services marks and logos referenced herein belong to their respective companies.

Nested procedures.

Unit summary.

Now that you have completed this unit, you should be able to:

• Code a statement to invoke and modify a nested procedure.