# ESCAPE IMMEDIATE

**URL:** <https://techcommunity.softwareag.com/t/escape-immediate/60945>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes\
**Created:** [May 10, 2006, 2:54pm UTC](https://techcommunity.softwareag.com/t/escape-immediate/60945 "2006-05-10T14:54:46Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahul\_mf](https://avatars.discourse-cdn.com/v4/letter/r/f08c70/32.png) [@rahul\_mf](https://techcommunity.softwareag.com/u/rahul_mf)\
**Post date:** [May 10, 2006, 2:54pm UTC](https://techcommunity.softwareag.com/t/escape-immediate/60945/1 "2006-05-10T14:54:46Z")

</div>

Hi all,

What is the difference between an ESCAPE BOTTOM and an ESCAPE IMMEDIATE statement??

Rahul

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [May 10, 2006, 6:00pm UTC](https://techcommunity.softwareag.com/t/escape-immediate/60945/2 "2006-05-10T18:00:31Z")

</div>

The Natural documentation says:

> [@](#):
>
> If you specify the keyword IMMEDIATE, no loop-end processing will be performed.

Example:

```auto
define data local
01 view-name view of ddm-name
  02 ab
end-define
*
read view-name
  at end of data
    write '--- END OF LIST ---'
  end-enddata
*
  write view-name
*  
  if *COUNTER >= 10
* escape bottom immediate /* uncomment this line for a test
    escape bottom
  end-if
end-read
end
```

---

<div class="post-metadata">

**Author:** ![Wilfried\_B](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/wilfried_b/32/83_2.png) [@Wilfried\_B](https://techcommunity.softwareag.com/u/Wilfried_B)\
**Post date:** [May 10, 2006, 7:20pm UTC](https://techcommunity.softwareag.com/t/escape-immediate/60945/3 "2006-05-10T19:20:51Z")

</div>

rahul\_mf, sometimes I get the feeling, that you think asking is easier than searching for the answers yourself!

Do you see the link that reads “Documentation” on top of this page? If not, you can look here: [http://developer.softwareag.com/ets/docu/nat\_docu.htm](http://developer.softwareag.com/ets/docu/nat_docu.htm). If you do not find an answer there, you can ask your questions in this forum.

---

<div class="post-metadata">

**Author:** ![rahul\_mf](https://avatars.discourse-cdn.com/v4/letter/r/f08c70/32.png) [@rahul\_mf](https://techcommunity.softwareag.com/u/rahul_mf)\
**Post date:** [May 11, 2006, 10:12am UTC](https://techcommunity.softwareag.com/t/escape-immediate/60945/4 "2006-05-11T10:12:04Z")

</div>

Matthias,

What actually does “loop-end processing” means ???

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [May 11, 2006, 12:18pm UTC](https://techcommunity.softwareag.com/t/escape-immediate/60945/5 "2006-05-11T12:18:22Z")

</div>

> [@rahul\_mf](#):
>
> What actually does “loop-end processing” means ???

As I wrote:

```auto
at end of data ...
```

---

<div class="post-metadata">

**Author:** ![rahul\_mf](https://avatars.discourse-cdn.com/v4/letter/r/f08c70/32.png) [@rahul\_mf](https://techcommunity.softwareag.com/u/rahul_mf)\
**Post date:** [May 13, 2006, 1:11am UTC](https://techcommunity.softwareag.com/t/escape-immediate/60945/6 "2006-05-13T01:11:39Z")

</div>

Matthias,

Does it mean that if in the above code the read statement does not contain the loop-end processing (in this cae “at end of data” statement)  
then in that case both ESCAPE BOTTOM and ESCAPE IMMEDIATE will do the same function,i.e.,we can use either of them.

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [May 15, 2006, 12:24pm UTC](https://techcommunity.softwareag.com/t/escape-immediate/60945/7 "2006-05-15T12:24:18Z")

</div>

> [@rahul\_mf](#):
>
> Does it mean that if in the above code the read statement does not contain the loop-end processing (in this cae “at end of data” statement)  
> then in that case both ESCAPE BOTTOM and ESCAPE IMMEDIATE will do the same function,i.e.,we can use either of them.

Yes!

But remember that an “ESCAPE IMMEDIATE” leads to a Natural Syntax Error (NAT0192). You have to write one of the following statements:

ESCAPE ROUTINE IMMEDIATE  
ESCAPE MODULE IMMEDIATE

---

<div class="post-metadata">

**Author:** ![rahul\_mf](https://avatars.discourse-cdn.com/v4/letter/r/f08c70/32.png) [@rahul\_mf](https://techcommunity.softwareag.com/u/rahul_mf)\
**Post date:** [May 15, 2006, 2:41pm UTC](https://techcommunity.softwareag.com/t/escape-immediate/60945/8 "2006-05-15T14:41:25Z")

</div>

Thanks a lot Matthias 😃

---

<div class="post-metadata">

**Author:** ![Douglas\_Kelly](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/douglas_kelly/32/102_2.png) [@Douglas\_Kelly](https://techcommunity.softwareag.com/u/Douglas_Kelly)\
**Post date:** [May 16, 2006, 3:14am UTC](https://techcommunity.softwareag.com/t/escape-immediate/60945/9 "2006-05-16T03:14:13Z")

</div>

Also:  
ESCAPE BOTTOM IMMEDIATE

That is, IMMEDIATE is an option to modify the ESCAPE BOTTOM/ROUTINE/MODULE clauses. IMMEDIATE bypasses non-procedural code such as AT BREAK, AT END, etc.

---

<div class="post-metadata">

**Author:** ![Matthias1](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@Matthias1](https://techcommunity.softwareag.com/u/Matthias1)\
**Post date:** [May 16, 2006, 12:33pm UTC](https://techcommunity.softwareag.com/t/escape-immediate/60945/10 "2006-05-16T12:33:19Z")

</div>

> [@Douglas Kelly](#):
>
> IMMEDIATE bypasses non-procedural code such as AT BREAK, AT END, etc.

Last week I realized that the processing of AT END OF PAGE is obviously not influenced by IMMEDIATE. Is there a special reason for this behaviour?

---

<div class="post-metadata">

**Author:** ![Klaus\_Sponagel](https://avatars.discourse-cdn.com/v4/letter/k/3bc359/32.png) [@Klaus\_Sponagel](https://techcommunity.softwareag.com/u/Klaus_Sponagel)\
**Post date:** [May 16, 2006, 3:07pm UTC](https://techcommunity.softwareag.com/t/escape-immediate/60945/11 "2006-05-16T15:07:36Z")

</div>

In my opinion AT END OF PAGE is not influenced by IMMEDIATE because AT END OF PAGE does not relate to a particular loop. Thus it is not part of the loop-end-processing.  
Only the AT conditions which relate to the ESCAPEed loop are affected by the IMMEDIATE.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:40pm UTC](https://techcommunity.softwareag.com/t/escape-immediate/60945/12 "2021-04-02T14:40:38Z")

</div>


