View previous topic :: View next topic
|
Author |
Message |
kasi_manickam
New User
Joined: 09 Jun 2005 Posts: 6 Location: CHENNAI
|
|
|
|
Hi,
In IF LOOP If WE specify TRUE what it means?
For this loop when ELSE CONDITION WORKS?
//STEP1 IF TRUE THEN
//COB2 EXEC PGM=PGM1,COND=(0,NE)
STATEMENTS
//ELSPART ELSE
//COB3 EXEC PGM=PGM2,COND=(0,NE)
STATEMENTS
//ENDPART ENDIF |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Manickam, what is this? It isn't JCL, since JCL doesn't look like your example. Is it supposed to represent some type of programming language? |
|
Back to top |
|
|
kasi_manickam
New User
Joined: 09 Jun 2005 Posts: 6 Location: CHENNAI
|
|
|
|
Hi,
Sorry for objecting your statement.
Like this type of code runs fine in our code in JCL.
It Never bothers about the previous return code and always go inside of TRUE LOOP.
1.)Whether this is compiler dependant ?
2.) When it will go for Else Loop?
3.) Which type of situation we use like this type of Loop? |
|
Back to top |
|
|
gpraveen
New User
Joined: 10 Jun 2005 Posts: 1
|
|
|
|
Yep, your JCL with the IF..THEN is perfectly fine. Version 4 and above of MVS/ESA does suppport this form of executing steps conditionally, thereby trying to make redundant the older method of using COND=(4,GE) and the like.
Moreover, the IF should be followed by a relational expression like
// IF STEP1.RC=0 THEN
Whereas, in your example, there is no condition. Therefore, it will always go into the IF part and never to the ELSE part. |
|
Back to top |
|
|
|