Rational Developer for System z
PL/I for Windows, Version 8.0, Programming Guide

Handling SQL error return codes

PL/I provides a sample program DSNTIAR.PLI that you can use to translate an SQLCODE into a multi-line message for display purposes. This PL/I program provides the same function as the DSNTIAR program on mainframe DB2*.

You must compile DSNTIAR with the same DEFAULT and SYSTEM compile-time options that are used to compile the programs that use DSNTIAR.

The caller must declare the entry and conform to the interface as described in the mainframe DB2 publications. For your information, the declaration is of the following form:

  dcl dsntiar entry options(asm inter retcode);

Three arguments are always passed:

arg 1
This input argument must be the SQLCA.
arg 2
This input/output argument is a structure of the form:
  dcl 1 Message,
        2 Buffer_length fixed bin(15) init(n), /* input  */
        2 User_buffer char(n);         /* output */
You must fill in the appropriate value for n.
arg 3
This input argument is a FIXED BIN(31) value that specifies logical record length.
Rational Developer for System z
PL/I for Windows, Version 8.0, Programming Guide