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

When PARA-1 and PARA-2 will execute in Evaluate query


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

New User


Joined: 21 Nov 2006
Posts: 48
Location: mumbai

PostPosted: Thu Jul 12, 2007 11:08 am
Reply with quote

Hi all,

i have following code..

EVALUATE W-NUM
WHEN 1
WHEN 2 PERFORM PARA-1

WHEN 3
WHEN 4 PERFORM PARA-2
WHEN OTHER PERFORM PARA-3

END-EVALUATE


when PARA-1 and PARA-2 will execute?
What will happen if value of W-NUM is 1?
Back to top
View user's profile Send private message
ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Thu Jul 12, 2007 11:33 am
Reply with quote

Hi,
Quote:
when PARA-1 and PARA-2 will execute?


Para-1 will be executed if value of W-NUM is 1 or 2.
Para-2 will be executed if value of W-NUM is 3 or 4.
Para-3 will be executed for any valid value of W-NUM other than 1,2, 3 or 4.

Quote:
What will happen if value of W-NUM is 1?
Above statement answers this question.

--Parag
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Jul 12, 2007 11:33 am
Reply with quote

From the FM:
If a WHEN phrase is selected, execution continues with the first imperative-statement-1 following the selected WHEN phrase. Note that multiple WHEN statements are allowed for a single imperative-statement-1.
Quote:
when PARA-1 and PARA-2 will execute?
When 1 or 2 and when 3 or 4 respectivly.
Quote:
What will happen if value of W-NUM is 1?
PARA-1 will execute.
Back to top
View user's profile Send private message
sudhakar_lendave

New User


Joined: 21 Nov 2006
Posts: 48
Location: mumbai

PostPosted: Thu Jul 12, 2007 11:37 am
Reply with quote

Thanks Parag, thanks William.
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Thu Jul 12, 2007 9:14 pm
Reply with quote

This is so easy to test - why ask first?
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 Execute secondary panel of sdsf with ... CLIST & REXX 1
No new posts RC query -Time column CA Products 3
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Fetch data from programs execute (dat... DB2 3
No new posts Query on edit primary command CLIST & REXX 5
Search our Forums:

Back to Top