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

How Escape Top work if coded instead of Escape Bottom


IBM Mainframe Forums -> Java & MQSeries
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
richie

New User


Joined: 11 Jun 2005
Posts: 24

PostPosted: Mon Mar 05, 2007 12:59 pm
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
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Mon Mar 05, 2007 1:37 pm
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
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Java & MQSeries

 


Similar Topics
Topic Forum Replies
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
No new posts Can EATTR be coded in an IMS COBOL pgm? IMS DB/DC 1
No new posts Negative value - packed field - Natur... Java & MQSeries 0
No new posts TWS - ETT File triggering does not wo... IBM Tools 4
Search our Forums:

Back to Top