TurboIMAGE/XL Database Management System Reference Manual MPE/iX V6.5 (30391-90011)
304 Chapter6
Host Language Access
RPG
Obtaining Error Messages and Explanations
The following subroutine implements the GET-ERROR-AND-EXPLAIN routine of the sample
program. Because RPG as yet does not have access to DBEXPLAIN and DBERROR, this
subroutine simply displays the TurboIMAGE/XL error number from the status array and
then allows the user to either abort the program or continue its execution. If the user
elects to abort, the LR indicator is set ON and the code which called this subroutine must
test for LR and exit immediately to its caller, which in turn must exit to its caller, and so
on.
****************************************************************
* G E T E R R S U B R O U T I N E *
****************************************************************
C GETERR BEGSR
C EXCPT ERRBUF
C GETOPT TAG
C READ TERMIN H0
C OPTION IFEQ "1"
C SETON LR
C ELSE
C OPTION IFEQ "2"
C EXCPT ERRCON
C ELSE
C EXCPT BADOPT
C GOTO GETOPT
C END
C END
C*
C ENDSR
Deļ¬ning Output
****************************************************************
* OUTPUT RECORD LAYOUTS *
****************************************************************
O*--------------------------------------------------------------
O* Display message for entry of invalid option.
O*
OTERMOUT E 1 BADOPT
O 23 "Invalid option - please"
O 33 " re-enter."
O*--------------------------------------------------------------
O* Send 'Home' (Escape h) and 'Clear' (Escape J) to screen.
O*
O E 1 CLEAR
O ESC 1
O 2 "h"
O ESC 3
O 4 "J"
O*--------------------------------------------------------------
O* Display message for IMAGE End-Of-Chain condition.
O*
O E 31 EOC
O 21 "-----> End of Chain, "
O 42 "Hit Enter to Continue"
O*--------------------------------------------------------------