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.
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