Skip to main content

Problem:

How can I call DSNTIAR from an Oracle (Pro*COBOL) application to retrieve the error message from a SQL operation?

Resolution:

To aid migration from Mainframe DB2, Oracle provide support for DSNTIAR, to retrieve error message text.

With parameters defined thus :

       01  ERROR-MESSAGE.

               02  ERROR-LEN   PIC S9(4)  COMP VALUE 240.

               02  ERROR-TEXT  PIC X(240).

       77  ERROR-TEXT-LEN      PIC S9(9)  COMP VALUE 240.

call DSNTIAR with :

       CALL 'DSNTIAR' USING SQLCA ERROR-MESSAGE ERROR-TEXT-LEN

and ERROR-TEXT will be populated with the error message text.

Old KB# 3856