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

reg EVALUATE in COBOL?


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
subramanianup
Warnings : 1

New User


Joined: 18 May 2005
Posts: 46
Location: Bangalore, INDIA

PostPosted: Tue Feb 07, 2006 4:00 pm
Reply with quote

What will happen in the following case
MOVE 5 TO PART1
MOVE 6 TO PART2

Which PARA will be performed in the following code,
EVALUATE TRUE
WHEN PART1=5
PERFORM A-PARA
WHEN PART2=6
PERFORM B-PARA
WHEN OTHER
NEXT SENTENCE
END-EVALUATE.
can anyone explain this?
Back to top
View user's profile Send private message
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 463

PostPosted: Tue Feb 07, 2006 4:05 pm
Reply with quote

HI,

Quote:
What will happen in the following case
MOVE 5 TO PART1
MOVE 6 TO PART2

Which PARA will be performed in the following code,
EVALUATE TRUE
WHEN PART1=5
PERFORM A-PARA
WHEN PART2=6
PERFORM B-PARA
WHEN OTHER
NEXT SENTENCE
END-EVALUATE.
can anyone explain this?



I believe PERFORM A-PARA will perform as it first check the first when statement and evaluate and after that not check the second when and terminate the EVALUATE.

Hope this helps

Regards
Rupesh
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


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

PostPosted: Tue Feb 07, 2006 4:22 pm
Reply with quote

Rupesh is correct.... This code will execute only A-PARA while going thru the EVALUATE statement.

You would like to see here...

Regards,

Priyesh.
Back to top
View user's profile Send private message
rajesh_1183

Active User


Joined: 24 Nov 2005
Posts: 121
Location: Tadepalligudem

PostPosted: Tue Feb 07, 2006 4:23 pm
Reply with quote

Yaa Rupesh is write.In the Evaluate...which ever the first WHEN condition that is true...is executed and exits from the EVALUATE.


Thanks,
Rajesh
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top