Page 1 of 1

executing certain steps in procs without executing other ste

PostPosted: Mon Jun 03, 2013 4:19 pm
by Farhaan4mf
Hello !!
I have a requirement as mentioned below
1. Create a JOB and a Proc
1.a Proc will have all the steps (example STEp1, STEP2, STEP3 STEP4 ..... STEP7)
1.b JOB should call the PROC in such a way that STEP4, STEP5... STEP7 should be executed if certain part of the parm value (if at all PARM can be used) becomes true.
1.c And only STEP1,STEP2 and STEP3 should be executed if the other part of the parm becomes true.

I am not sure if the idea of using parm can give me the correct design. Anyone please give the idea to achieve this design.

Regards,
Farhaan

Re: executing certain steps in procs without executing other

PostPosted: Mon Jun 03, 2013 4:45 pm
by Robert Sample
1. What you want to do cannot be achieved solely through JCL. The first step of the job executes (unless RESTART is being used) -- period. There is no parameter value you can provide that will change that behavior of the system.

2. A PARM sets values; those values do not "become true" -- the value is set for the entire execution of the job, period.

3. It sounds like what you need is a front-end process to determine which steps need to execute and create a job that includes the steps you want to execute.

Re: executing certain steps in procs without executing other

PostPosted: Tue Jun 04, 2013 11:41 pm
by dick scherrer
Hello,

One way to get what you want is to introduce a new first step that processes a parm and sets a return code to control the remainder of the processing. With a little bit of design, you can conditionally execute the remainder of the steps by looking at the single return code.

Using a one/zero value assign the return code so that it reflects the run/norun condition for that step:

To run   then
Step 1   add 1
Step 2   add 2
Step 3   add 4
Step 4   add 8

etc. for as many steps that you want to control.

Read the parm and when valid, move this to the RETURN-CODE. Check this in the following JCL.

For example - to run steps 2 and 3, the parm would be 6, to run steps 1 and 4 the parm would be 9.

Re: executing certain steps in procs without executing other

PostPosted: Wed Jun 05, 2013 12:01 am
by Robert Sample
One comment: Dick's method will work up to 11 steps. However, job step return codes are limited to a maximum value of 4095 so if you need to control more than 11 steps then you will need a different method.