IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

In IF LOOP If WE specify TRUE what does it mean


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kasi_manickam

New User


Joined: 09 Jun 2005
Posts: 6
Location: CHENNAI

PostPosted: Thu Jun 09, 2005 5:28 am
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Jun 09, 2005 5:02 pm
Reply with quote

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
View user's profile Send private message
kasi_manickam

New User


Joined: 09 Jun 2005
Posts: 6
Location: CHENNAI

PostPosted: Thu Jun 09, 2005 5:59 pm
Reply with quote

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
View user's profile Send private message
gpraveen

New User


Joined: 10 Jun 2005
Posts: 1

PostPosted: Fri Jun 10, 2005 9:04 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts To find whether record count are true... DFSORT/ICETOOL 6
This topic is locked: you cannot edit posts or make replies. REXX - Do - Not able to LOOP CLIST & REXX 10
No new posts REXX - Dataset checking in a do forev... CLIST & REXX 6
No new posts Need to read duplicate rows from tabl... DB2 3
This topic is locked: you cannot edit posts or make replies. Cobol db2 program going in loop COBOL Programming 4
Search our Forums:

Back to Top