executing certain steps in procs without executing other ste



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

executing certain steps in procs without executing other ste

Postby Farhaan4mf » Mon Jun 03, 2013 4:19 pm

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
Farhaan4mf
 
Posts: 29
Joined: Mon May 13, 2013 4:53 pm
Has thanked: 0 time
Been thanked: 0 time

Re: executing certain steps in procs without executing other

Postby Robert Sample » Mon Jun 03, 2013 4:45 pm

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.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: executing certain steps in procs without executing other

Postby dick scherrer » Tue Jun 04, 2013 11:41 pm

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: executing certain steps in procs without executing other

Postby Robert Sample » Wed Jun 05, 2013 12:01 am

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.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post