Escape bottom and Escape Bottom Immediate

Software AG's platform-independent programming language with full support for open-source and Internet applications
diptisaini
Posts: 90
Joined: Sun Mar 14, 2010 5:12 pm
Skillset: Natural,Adabas,jcl
Referer: friend

Escape bottom and Escape Bottom Immediate

Postby diptisaini » Wed Nov 02, 2011 5:45 pm

Hi,

I just want to know what is the difference between Escape Bottom and Escape Bottom Immediate. Can anyone explain me with an example?

Immediate Option:
If you specify the keyword IMMEDIATE, no loop-end processing will be performed.

I am not able to understand what the meaning of loop-end processing? When we have to use immediate and when not ?????/

NicC
Global moderator
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Skillset: JCL, PL/1, Rexx, Utilities and to a lesser extent (i.e. I have programmed using them) COBOL,DB2,IMS
Referer: Google
Location: Pushing up the daisies (almost)

Re: Escape bottom and Escape Bottom Immediate

Postby NicC » Thu Nov 03, 2011 1:43 am

Did you look up loop-ending processing?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic

User avatar
RGZbrog
Posts: 101
Joined: Mon Nov 23, 2009 1:34 pm
Skillset: Natural, Adabas, Predict, Natural Security, Construct, EntireX, SPoD, NaturalONE
Referer: SAG Developer Forum
Location: California, USA
Contact:

Re: Escape bottom and Escape Bottom Immediate

Postby RGZbrog » Thu Nov 03, 2011 12:21 pm

Loop-end processing refers to AT END OF DATA and AT BREAK statements. The keyword IMMEDIATE means that you don't want Natural to invoke the AT END OF DATA nor to force a final break.

An example without IMMEDIATE:

Code: Select all

DEFINE DATA LOCAL
1 EMP    VIEW EMPLOYEES
  2 PERSONNEL-ID
END-DEFINE
READ EMP BY PERSONNEL-ID FROM '11100108'
  AT BREAK OF PERSONNEL-ID /7/
    WRITE 5X '1 break'
  END-BREAK
  AT END OF DATA
    WRITE 5X '1 end data'
  END-ENDDATA
  /*
  WRITE '1' PERSONNEL-ID
  IF  *COUNTER = 5
    THEN
      ESCAPE BOTTOM
  END-IF
END-READ
END

Code: Select all

1 11100108
1 11100109
     1 break
1 11100110
1 11100111
1 11100112
     1 break
     1 end data
 

The same example with IMMEDIATE:

Code: Select all

DEFINE DATA LOCAL
1 EMP    VIEW EMPLOYEES
  2 PERSONNEL-ID
END-DEFINE
READ EMP BY PERSONNEL-ID FROM '11100108'
  AT BREAK OF PERSONNEL-ID /7/
    WRITE 5X '2 break'
  END-BREAK
  AT END OF DATA
    WRITE 5X '2 end data'
  END-ENDDATA
  /*
  WRITE '2' PERSONNEL-ID
  IF  *COUNTER = 5
    THEN
      ESCAPE BOTTOM IMMEDIATE
  END-IF
END-READ
END

Code: Select all

2 11100108
2 11100109
     2 break
2 11100110
2 11100111
2 11100112