View previous topic :: View next topic
|
Author |
Message |
aakar
New User
Joined: 08 Apr 2008 Posts: 36 Location: mumbai
|
|
|
|
Based on a return code from a Particular Proc step am trying to decide a dataset qualifier in the next proc step as follows:
Job step1 :
PS1
PS2 : RC = 0
PS3
PS4
Have given the following SET command as far as :
//JSET1 IF (JS1.PS2.RC = 0) THEN
// SET PPGM3=ABCD
//JSET1EL ELSE
// SET PPGM3=EFGH
//JSET1EN END IF
Job step2 :
PS1
PS2 : Where the dataset is being used, as XXXX.YYY.&PPGM3..FILE in DISP=SHR
PS3
PS4
When JS1.PS2.RC gives 0 , as per the JCL it should give a value 'ABCD' to PPGM3 but it is always giving a value of 'EFGH' instead, irrespective of what is the value of JS1.PS2.RC.
The symbolic varaiable has not been in the proc but has not been assigned any value in the procedure. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
The IF THEN ELSE ENDIF structure can only be used to control the execution of steps. The &PPGM3 is resolved at the time the jcl is submitted before any steps are executed. Set up two PS2 steps (PS2A AND PS2B) one with each version of the dsn and use the IF THEN ELSE ENDIF structure to control which one will be executed. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Instead of trying to determine what we need to see, you should post all of the relevant info.
Post your jcl as well as the expanded jcl from an execution. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Craq Giegerich wrote: |
The IF THEN ELSE ENDIF structure can only be used to control the execution of steps. The &PPGM3 is resolved at the time the jcl is submitted before any steps are executed. |
Does that means that if the set were done in two different steps and the second step was skipped, the second set would be in force anyway? |
|
Back to top |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
Quote: |
Does that means that if the set were done in two different steps and the second step was skipped, the second set would be in force anyway? |
Yes |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
The set statement is processed unconditionally when the jcl is interpreted before any steps are executed. If you have a job stream with a set at the beginning and another set in the middle for the same variable but a different value then that parameter will have a different value in different steps. |
|
Back to top |
|
|
|