Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
How Escape Top work if coded instead of Escape Bottom

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> NATURAL & MQSERIES
Author Message
richie
Warnings : 1

New User


Joined: 11 Jun 2005
Posts: 23

PostPosted: Mon Mar 05, 2007 12:59 pm    Post subject: How Escape Top work if coded instead of Escape Bottom
Reply with quote

Hi,

Please confirm my understanding on escape Bottom.
Escape Bottom executes the next line following the loop.

If i code an escape bottom between IF- ENDIF , then the statement after ENDIF would be executed.

So, in below ex MOVE *TIMN TO #TIME and below wud be excecuted .Please let me know if i understand it correctly.

Also how wud Escape Top work here if coded instead of Escape Bottom.


RD01.
READ (1) TABLE WITH KEY = #KEY

IF FLAG EQ #FLAG AND
TABLE EQ #TABLE AND
MOVE *ISN TO #ISN
ESCAPE BOTTOM
END-IF
*
MOVE *TIMN TO #TIME

IF #ISN=0
STORE A RECORD
ET

END-READ


Thankyou all for your help.
Back to top
View user's profile Send private message
References
PostPosted: Mon Mar 05, 2007 12:59 pm    Post subject: Re: How Escape Top work if coded instead of Escape Bottom Reply with quote

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 1789
Location: Israel

PostPosted: Mon Mar 05, 2007 1:37 pm    Post subject:
Reply with quote

ESCAPE (TOP, BOTTOM & ROUTINE) can be coded only within a loop or routine. They are not valid within IF.

O.
Back to top
View user's profile Send private message
Raj Kiran

New User


Joined: 24 Aug 2007
Posts: 3
Location: Chennai

PostPosted: Fri Aug 24, 2007 4:25 pm    Post subject:
Reply with quote

Hi

the Escape bottom comes out of the IF-ENDIF(if the condition is true) and it wont execute the next statement

RD01.
READ (1) TABLE WITH KEY = #KEY

IF FLAG EQ #FLAG AND
TABLE EQ #TABLE AND
MOVE *ISN TO #ISN
ESCAPE BOTTOM
END-IF
*
MOVE *TIMN TO #TIME

IF #ISN=0
STORE A RECORD
ET

END-READ

in this code Escape bottom comes out of the Read and executes the next statement after the read

in the below example if u give escape top
RD01.
READ (1) TABLE WITH KEY = #KEY

IF FLAG EQ #FLAG AND
TABLE EQ #TABLE AND
MOVE *ISN TO #ISN
ESCAPE TOP
END-IF
*
MOVE *TIMN TO #TIME

IF #ISN=0
STORE A RECORD
ET

END-READ

it comes out of IF (if the condition is true) and again goes back to the read statement and doesn't go to the next statement(move statement)

and comes out of the read as u have given READ(1). if u have as READ it reads another record.


Hope u got it
Raj
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> NATURAL & MQSERIES All times are GMT + 6 Hours
Page 1 of 1