# Question on AT TOP OF  PAGE / AT END OF PAGE statement

**URL:** <https://techcommunity.softwareag.com/t/question-on-at-top-of-page-at-end-of-page-statement/61732>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes\
**Created:** [November 28, 2006, 11:41am UTC](https://techcommunity.softwareag.com/t/question-on-at-top-of-page-at-end-of-page-statement/61732 "2006-11-28T11:41:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![selva](https://avatars.discourse-cdn.com/v4/letter/s/13edae/32.png) [@selva](https://techcommunity.softwareag.com/u/selva)\
**Post date:** [November 28, 2006, 11:41am UTC](https://techcommunity.softwareag.com/t/question-on-at-top-of-page-at-end-of-page-statement/61732/1 "2006-11-28T11:41:02Z")

</div>

Hi,

Is it possible to have more than one AT TOP OF PAGE / AT END OF PAGE statement for a single report in the same program?

OR is it restricted to have only one AT TOP OF PAGE / AT END OF PAGE statement per report per program?

Thanks,  
Selva.

---

<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:** [November 28, 2006, 1:40pm UTC](https://techcommunity.softwareag.com/t/question-on-at-top-of-page-at-end-of-page-statement/61732/2 "2006-11-28T13:40:03Z")

</div>

Hello Selva!

Only one AT TOP/END OF PAGE is permitted per report and program. Otherwise you’ll get one of the following Errors:

> [@](#):
>
> NAT0040 Only one AT TOP OF PAGE statement allowed per report.  
> NAT0041 Only one AT END OF PAGE statement allowed per report.

Do you really want to use more than one?

---

<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:** [November 28, 2006, 1:58pm UTC](https://techcommunity.softwareag.com/t/question-on-at-top-of-page-at-end-of-page-statement/61732/3 "2006-11-28T13:58:36Z")

</div>

I even haven’t ever seen a sheet of paper with more than one top side and more than one bottom side! 😉

If you mean conditional page headers and footers, you can of course implement these:

```auto
 AT TOP OF PAGE
DECIDE FOR FIRST CONDITION
WHEN condition1
  page header 1
WHEN condition2
  page header 2
...
WHEN NONE
...
END-DECIDE
END-TOPPAGE
```

But be aware: before changing the condition values issue a NEWPAGE, as the condition is evaluated just before the first line on the page is printed. For AT END OF PAGE the condition is evaluated just before executing the NEWPAGE.

---

<div class="post-metadata">

**Author:** ![selva](https://avatars.discourse-cdn.com/v4/letter/s/13edae/32.png) [@selva](https://techcommunity.softwareag.com/u/selva)\
**Post date:** [November 28, 2006, 2:24pm UTC](https://techcommunity.softwareag.com/t/question-on-at-top-of-page-at-end-of-page-statement/61732/4 "2006-11-28T14:24:12Z")

</div>

Thanks for the replies

Regards,  
Selva.

---

<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:** [November 28, 2006, 3:06pm UTC](https://techcommunity.softwareag.com/t/question-on-at-top-of-page-at-end-of-page-statement/61732/5 "2006-11-28T15:06:21Z")

</div>

[quote="Wilfried B

---

<div class="post-metadata">

**Author:** ![Henrik\_Hermansen1](https://avatars.discourse-cdn.com/v4/letter/h/f9ae1b/32.png) [@Henrik\_Hermansen1](https://techcommunity.softwareag.com/u/Henrik_Hermansen1)\
**Post date:** [November 29, 2006, 6:41pm UTC](https://techcommunity.softwareag.com/t/question-on-at-top-of-page-at-end-of-page-statement/61732/6 "2006-11-29T18:41:48Z")

</div>

Actually you can have one set of AT TOP and AT END for each report like this:

AT TOP OF PAGE (0)  
Write ‘Top of screen’  
…

AT TOP OF PAGE (1)  
Write ‘Top of page on list 1’  
…

* * *

Edit:  
Okay after posting I saw that you question was restricted to a single report, sorry!

---

<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/question-on-at-top-of-page-at-end-of-page-statement/61732/7 "2021-04-02T14:40:57Z")

</div>


