JCL to read CONTROL CARD data & change the course of action

Hi,

I need some suggestion on below query. Requirement details are mentioned below.

Code one JCL with 4 steps (STEP01, STEP02, STEP03, STEP04). Now STEP01 will read one CONTROL CARD data and as per the contents of that CONTROL CARD data next step execution will be decided.

CONTROL CARD will have either 01 or 02 or 03. Now if 01 there in the CONTROL CARD then STEP02 will execute, if 02 then STEP03 will execute and if 03 then STEP04 will execute.

This should be done by using only one JCL (IBM Utility programs can be used). No COBOL,PL/1 or REXX coding can be used..

Example: (Just an example)
--------------------------------------------
Suppose the data entered in the CONTROL CARD file is ‘02’ then back up XXXXXX dataset (in STEP03) in to a GDG version.

I am not very sure how to do that (my first impression was this can not be done by using only JCL or with the help of IBM utilities).. I checking on some SORT utilities or ICETOOL for this... but if anyone has any idea and can share with me then I would be grateful!

Questions by subratachrec

Showing Answers 1 - 6 of 6 Answers

One of the approaches I can think of is instead create 3 procs and call the proc depending on the value in control card (populate proc value name from control card).

  Was this answer useful?  Yes

Rajesh

  • Aug 1st, 2014
 

I will suggest write a cobol program in step 1 to read the SYSIN value and based on the value set Return code value. For example
Value Return code set
01 01
02 02
03 03
04 04,

No, from the step 2 to Step 4 , we can use IF-ENDIF criteria to run that particular step.
If (STEP1.RC=2)
run Step 2
Else If (STEP1.RC=3)
run Step 3
Else If (STEP1.RC=4)
run Step 4
End-if

Hope it helps

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions