Errors that occur while accessing DB2 in the z/OS operating environment are not written to the log or stored in macro variables


In the z/OS operating environment, if you run a query that accesses DB2, any errors that occur might not be written to the SAS® log. In such a case, a generic note or error is written to the SAS log to indicate that a DB2 error occurred. The note or error might look like one of the following:

NOTE: The SAS System stopped processing this step because of errors.

ERROR: (ACCDB2M013E) Error opening cursor.

The return code and error message are also not stored in the appropriate macro variables:

%put &sysdbrc;
-1
%put &sysdbmsg;
DB2:

To determine what is causing the error, add the following OPTIONS statement before the step that is causing the error:

options sastrace=',,d,d';

Additional information should then be written to the log, including information about the DB2 error that occurred.