Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

 COND Parameter Problem Goto page 1, 2  Next
Author Message
sundeep_rajasekaran
Warnings : 1

New User

Joined: 18 Feb 2005
Posts: 14

 Posted: Wed Aug 17, 2005 8:36 pm    Post subject: COND Parameter Problem Please find the details of the requirement given below ? There are 2 steps in a proc. The 2nd step has to be executed only if the return code (RC) of the previous step is 4 or 20. For any other RC value of STEP1, the 2nd step needs to be bypassed. This has to be done using COND parameter. (IF ? THEN cannot be used) I tried searchin for 'AND' operator in this forum, but to no avail. Immediate Reply will be appreciated

priyesh.agrawal

Senior Member

Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

Posted: Wed Aug 17, 2005 8:50 pm    Post subject: Re: COND Parameter Problem

Hi sundeep,

Try the COND Below...

 Code: //STEP1 //:: //:: //STEP2 EXEC=PGM,COND=((4,NE,STEP1),(20,NE,STEP1)) //:: //:: //

Regards,

Priyesh.
shivashunmugam Muthu

Active User

Joined: 22 Jul 2005
Posts: 114
Location: Chennai

 Posted: Thu Aug 18, 2005 9:36 am    Post subject: Like Priyesh's code, you can have maximum of 8 conditions in one exec-cond. jus FYI plz
senti

New User

Joined: 18 Aug 2005
Posts: 19

 Posted: Thu Aug 18, 2005 11:15 am    Post subject: Re: COND Parameter Problem Hey Priyesh, - A step will be executed only if the CONDition is "false". - If, you are specifying more than one condition in a step, Logical 'OR' condition is applied( and not 'AND') - Hence, your condition code as below will not work as Sundeep wants the step to be executed only if the previous step return either 4 or 20. COND=((4,NE,STEP1),(20,NE,STEP1)) Sundeep, There is no stright forward method of performing 'AND' operation in condition codes.I guess, on a similar occassion i remember introducing a dummy step in between. Condition codes are pretty nifty, and i hope i am not wrong this time around Thanks, Senthil
shivashunmugam Muthu

Active User

Joined: 22 Jul 2005
Posts: 114
Location: Chennai

Posted: Thu Aug 18, 2005 12:04 pm    Post subject:

 Quote: you are specifying more than one condition in a step, Logical 'OR' condition is applied( and not 'AND')

Senti...what u said is rt.....but also jus refer what he mentioned

 Quote: 2nd step has to be executed only if the return code (RC) of the previous step is 4 or 20

whatever it is...the prev step can have only one RC not both....what do u say?[/quote]
senti

New User

Joined: 18 Aug 2005
Posts: 19

 Posted: Thu Aug 18, 2005 12:16 pm    Post subject: Re: COND Parameter Problem OK, Lets work on expanding the condition, Case1) Previous step returns '4' COND=((4,NE,STEP1),(20,NE,STEP1)) = ((4,NE,4) OR (20 NE 4)) = F OR T = TRUE Hence the step will not be executed. Similarly, step will not be executed if the previous step returns 20. Case2) Previous step returns '10' COND=((4,NE,STEP1),(20,NE,STEP1)) = ((4,NE,10) OR (20 NE 10)) = T OR T = TRUE Hence the step will not be executed. Hence, the step will always be flushed out. Right..? Thanks, Senthil
shivashunmugam Muthu

Active User

Joined: 22 Jul 2005
Posts: 114
Location: Chennai

 Posted: Thu Aug 18, 2005 12:23 pm    Post subject: Yes...Senthil... I agree:) Thanks...
sundeep_rajasekaran
Warnings : 1

New User

Joined: 18 Feb 2005
Posts: 14

 Posted: Thu Aug 18, 2005 12:30 pm    Post subject: Re: COND Parameter Problem Hi ppl, Thanks for the quick replies. As senthil said, it is being bypassed everytime. Can we not do something with 'ONLY' or 'EVEN' operators?
priyesh.agrawal

Senior Member

Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

 Posted: Thu Aug 18, 2005 12:35 pm    Post subject: Re: COND Parameter Problem Hi Senthil, You are correct....In the code above STEP2 will always be flushed. sundeep, Why dont you use IF- THEN instead...... Well, If that is mandatory not to use IF - THEN, use another trick.... I would have coded two consecutive STEP2 with two different COND... One for 4 & other for 20... Let me know if that work. Regards, Priyesh.
sundeep_rajasekaran
Warnings : 1

New User

Joined: 18 Feb 2005
Posts: 14

 Posted: Thu Aug 18, 2005 10:29 pm    Post subject: Re: COND Parameter Problem Hi Priyesh, The Jcl gave an error when i tried your solution. cuz of duplicate step name. As you said, If - then will be a lot more easier, but client insists on using only COND parameters. If COND is truly not feasible, then i will have to insist on changing to IF-THEN. Are you sure that there is no other alternative?
priyesh.agrawal

Senior Member

Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

Posted: Thu Aug 18, 2005 10:36 pm    Post subject: Re: COND Parameter Problem

Hi sundeep,

 Quote: The Jcl gave an error when i tried your solution. cuz of duplicate step name

So change the name of steps man...whats the problem....

 Quote: As you said, If - then will be a lot more easier, but client insists on using only COND parameters.

....why so....

 Quote: Are you sure that there is no other alternative?

That I already gave you above....

Regards,

Priyesh.
senti

New User

Joined: 18 Aug 2005
Posts: 19

 Posted: Fri Aug 19, 2005 2:25 pm    Post subject: Re: COND Parameter Problem Hey priyesh, If you are having two consequetive steps then, How do u specify the condition code the second step.(i.e step checking RC=20)? Please note that at this point we need to check for the return code of the belwo two 1) Step returning RC 4 or 20 2) Previous step which checks for RC= 4. FYI - If this step executes or flushes, do we have a way to determine? Thanks, Senti[/quote]

New User

Joined: 19 Aug 2005
Posts: 3

 Posted: Fri Aug 19, 2005 2:50 pm    Post subject: use EQ instead of NE Hi, I think if u replace ur NE with EQ then it will work. I mean to say that //STEP1 // // //STEP2 EXEC PGM='ABC', COND=((4,EQ,STEP1),(20,EQ,STEP1)) // I think it will work. Madhavam FIC,Hyderabad
priyesh.agrawal

Senior Member

Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

Posted: Fri Aug 19, 2005 2:59 pm    Post subject: Re: COND Parameter Problem

Dear Senti,

 Quote: If you are having two consequetive steps then, How do u specify the condition code the second step.(i.e step checking RC=20)?

 Code: //S001  EXEC PGM=IDCAMS                          //IN   DD DSN=TEST.DATA.SET,DISP=SHR      //SYSPRINT DD SYSOUT=*                            //SYSIN    DD DATA                                   PRINT INFILE(IN) COUNT(1)                      /*                                                //*                                              //S002  EXEC PGM=IDCAMS,COND=(4,NE,S001)          //IN   DD DSN=TEST.DATA.SET.OTHER,DISP=SHR      //SYSPRINT DD SYSOUT=*                            //SYSIN    DD DATA                                   PRINT INFILE(IN) COUNT(1)                      /*                                                //*                                              //S003  EXEC PGM=IDCAMS,COND=(0,NE,S001)          //IN   DD DSN=TEST.DATA.SET.OTHER,DISP=SHR      //SYSPRINT DD SYSOUT=*                            //SYSIN    DD DATA                                   PRINT INFILE(IN) COUNT(1)              /* //

Here in the code S002 & S003 are same in functioning. But they are being executed on the basis of RC from S001.

S001 checking for empty file...Returns 4 in case of empty, else 0.
S002 executes if S001.RC=4
S003 executes if S001.RC=0.

 Quote: Please note that at this point we need to check for the return code of the belwo two 1) Step returning RC 4 or 20 2) Previous step which checks for RC= 4. FYI - If this step executes or flushes, do we have a way to determine?

1) Its being done in the code above.
2) FYI - If this step executes or flushes, do we have a way to determine?
What do you want to determine in this case....If S002 executes means S001 returned 4 & not 0....So it'll flush S003.
If S002 flushes means S001 returned 0, not 4....So S003 executes.

I hope I m clear ....else try to execute the code.....

Sundeep,

Regards,

Priyesh.
senti

New User

Joined: 18 Aug 2005
Posts: 19

 Posted: Fri Aug 19, 2005 3:19 pm    Post subject: Re: COND Parameter Problem Hey Priyesh, Somehow we are not on same page, From what sundeep has posted i guess he needs to execute a step if the previous step has returned either 4 or 20. Your code handles only 4. What about RC 20..? Regds, Senti
elonics

New User

Joined: 05 Jul 2005
Posts: 49
Location: India

 Posted: Fri Aug 19, 2005 3:34 pm    Post subject: Hi Friends, Priyesh is correct. But u have to take care of return code 20 also. So i wat i request the needy is to code the cond in the following way. In Step2 Code the condition as Cond=(4,NE,STEP1) In Step3 Code the Condition as Cond=((20,NE,STEP1),(0,E,STEP2)) Step2 and Step3 will have same things to be executed. Corrections are Sweetly Regreted since this will work Elo'nics
priyesh.agrawal

Senior Member

Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

Posted: Fri Aug 19, 2005 3:56 pm    Post subject: Re: COND Parameter Problem

elonics,

 Quote: But u have to take care of return code 20 also.

For that only I mentioned Please change the code as per your requirement. .

The code I gave above is for either 4 or 0. By replacing 0 from the code to 20 will exactly sove ...what sundeep asked for.....

 Quote: In Step3 Code the Condition as Cond=((20,NE,STEP1),(0,E,STEP2))

Why one bothering for RC from STEP2, when it is irrelevent to the STEP3.

Senti,
 Quote: Hey Priyesh, Somehow we are not on same page, From what sundeep has posted i guess he needs to execute a step if the previous step has returned either 4 or 20. Your code handles only 4. What about RC 20..?

Our original prob started executing a stepon having 4 or 20 from STEP1. I m just coded the same step two times (S002 & S003). & they 'll execute on the different RC from S001, which u can mention on COND parm.

Please try to execute the code given....It should help ...

P.S. Please change RC 0 to 20 in the code above, along with the steps concerned. I did it for 4 & 0.

Regards,

Priyesh.
elonics

New User

Joined: 05 Jul 2005
Posts: 49
Location: India

 Posted: Fri Aug 19, 2005 4:17 pm    Post subject: Got u. Thanx, Elonics.
senti

New User

Joined: 18 Aug 2005
Posts: 19

 Posted: Fri Aug 19, 2005 4:56 pm    Post subject: Re: COND Parameter Problem Yes priyesh, U are rite..!!
priyesh.agrawal

Senior Member

Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

 Posted: Fri Aug 19, 2005 5:05 pm    Post subject: Re: COND Parameter Problem Thanks Senti/elonics....for putting effort..... Sundeep... Let all of us know.... whether you were able to deliver up to ur clients expactation....Do this work for you.... Regards, Priyesh.
 All times are GMT + 6 HoursGoto page 1, 2  Next
 Page 1 of 2

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics File data to symbolic parameter madprasy JCL & VSAM 5 Wed Mar 13, 2019 11:14 am Pipeline scan problem John Poulakos CICS 1 Thu Feb 28, 2019 10:02 pm Problem while Decompressing the ZIP file Nethraa All Other Mainframe Topics 2 Tue Feb 26, 2019 6:55 am Problem while Decompressing the ZIP file Nethraa All Other Mainframe Topics 6 Fri Feb 22, 2019 11:41 pm PARAMETER 'F1' IS UNIDENTIFIED error ... Poha Eater DFSORT/ICETOOL 14 Fri Feb 01, 2019 2:39 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us