# Error NAT1108?

**URL:** <https://techcommunity.softwareag.com/t/error-nat1108/60862>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-on-Mainframes\
**Created:** [April 25, 2006, 10:55am UTC](https://techcommunity.softwareag.com/t/error-nat1108/60862 "2006-04-25T10:55:06Z")\
**Posts on this page:** 4\
**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:** [April 25, 2006, 10:55am UTC](https://techcommunity.softwareag.com/t/error-nat1108/60862/1 "2006-04-25T10:55:06Z")

</div>

Hi all,

I am getting the following error in one of my program:

NAT1108 REINPUT statement not preceded by INPUT statement

A small part of the code is given below–\>

WRITE ‘ENTER THE NAME’  
INPUT #NAME  
PERFORM INSUBRTRR8  
WRITE ‘THE CITY IS’#CITY  
RESET #NAME  
WRITE ‘ENTER ANOTHER NAME’  
REINPUT #NAME

Can anyone clarify why it is giving this error?

Rahul

---

<div class="post-metadata">

**Author:** ![Venkatesan\_Devaraj1](https://avatars.discourse-cdn.com/v4/letter/v/848f3c/32.png) [@Venkatesan\_Devaraj1](https://techcommunity.softwareag.com/u/Venkatesan_Devaraj1)\
**Post date:** [April 25, 2006, 12:25pm UTC](https://techcommunity.softwareag.com/t/error-nat1108/60862/2 "2006-04-25T12:25:19Z")

</div>

Explanation of error:

## When a REINPUT statement is to be executed, the last communication with the screen must have been via an INPUT statement. REINPUT is not permitted for a screen that was produced by a WRITE or DISPLAY statement. Neither is REINPUT permitted for an INPUT statement inside a loop, subroutine or special condition block, when the loop, subroutine or special condition block has already been terminated. e.g.: REPEAT INPUT … ESCAPE LOOP REINPUT will produce this error because at execution of the REINPUT statement the loop which contains the respective INPUT statement has already been closed.

If you remove the write statements before REINPUT then it will work. if we use WRITE/display with REINPUT then we get this error. if possible move write statment in separate subroutine after input/reinput processing completed to check the values entered.

---

<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:** [April 25, 2006, 12:25pm UTC](https://techcommunity.softwareag.com/t/error-nat1108/60862/3 "2006-04-25T12:25:54Z")

</div>

Between INPUT and REINPUT no WRITEs are allowed.

Please try the following code instead:

```auto
REPEAT
  INPUT 'ENTER THE NAME' #NAME /
    'THE CITY IS ' #CITY (AD=O) /
    'PF12 to CANCEL'
  PERFORM INSUBRTRR8
  RESET #NAME
  IF *PF-KEY = 'PF12'
    ESCAPE BOTTOM
  END-IF
END-REPEAT
```

---

<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/error-nat1108/60862/4 "2021-04-02T14:40:35Z")

</div>


