View previous topic :: View next topic |
Author |
Message |
JCLGuy Beginner

Joined: 29 Jan 2010 Posts: 4 Topics: 2
|
Posted: Sun Jan 31, 2010 2:37 pm Post subject: Re execute PROC with IF/THEN statement |
|
|
Hi all,
My Job card contains a conditional statement which execute the same PROC with different input files according the Job PGM RC.
That PROC has a conditional statement too.
The PROC act like no condition had been set in it.
Does anyone have an explanation ? what should I do to make it works ?
The code : Code: |
//****************
//PROC1 PROC
//****************
//P1 EXEC PGM=...
// IF PROC1.P1.RC=0 THEN
// ..
// ELSE
// ..
// ENDIF
// PEND
//****************
//*
//STEP1 EXEC PGM=...
// IF (STEP1.RC=1) THEN
//EX1 EXEC PROC1,FILE=&FILE1
// ENDIF
//*
// IF (STEP1.RC=2) THEN
//EX2 EXEC PROC1,FILE=&FILE2
// ENDIF
//* |
So, in run time the IF statement in the PROC is always act according the RC from the job card instead of it's internal PGM RC.
Thanks,
Josef. |
|
Back to top |
|
 |
superk Advanced

Joined: 19 Dec 2002 Posts: 684 Topics: 5
|
Posted: Sun Jan 31, 2010 7:11 pm Post subject: |
|
|
It worked OK for me. Could you provide some actual runtime details that would show us where it might be failing? |
|
Back to top |
|
 |
Anuj Dhawan Intermediate
Joined: 19 Jul 2007 Posts: 298 Topics: 7 Location: Mumbai,India
|
Posted: Mon Feb 01, 2010 5:44 am Post subject: |
|
|
is it related to the other thread you started lately, if yes - I believe, you've an answer there. _________________ Regards,
Anuj |
|
Back to top |
|
 |
JCLGuy Beginner

Joined: 29 Jan 2010 Posts: 4 Topics: 2
|
Posted: Mon Feb 01, 2010 11:17 am Post subject: |
|
|
Hi,
Thank you all for your replies.
First of all, this subject is not related to my previous thread (even it's look like it at first sight ).
About runtime details, i will try to provide some later.
Thanks again,
Josef |
|
Back to top |
|
 |
Terry_Heinze Supermod
Joined: 31 May 2004 Posts: 391 Topics: 4 Location: Richfield, MN, USA
|
Posted: Mon Feb 01, 2010 3:22 pm Post subject: |
|
|
I'm confused; why is the step P1 IF statement worded the way it is? Aren't you checking the return code of something that has not yet executed? _________________ ....Terry |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Wed Feb 03, 2010 1:47 am Post subject: |
|
|
Terry
The IF tests the return code from the program in step P1. This is coded before the IF statement - only no DD statements have been shown for step P1. For clarity the OP should have coded a comment line between the EXEC and the IF. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
 |
|
|