Problems in stored procedures

An SQL code and a few characters of an SQL error message are returned in response to either the ADMIN_TASK_ADD stored procedure or the ADMIN_TASK_REMOVE stored procedure.

Symptoms

An SQL code is returned.

Diagnosing the problem

An SQL code other than 0 indicates that Db2 encountered a problem calling the stored procedure.

An SQL code of 0 is accompanied by a return code and an error message in the output parameters RETURN_CODE and MSG. The return code is 0 if the scheduled task could be added or removed successfully. If the return code is 12, an error occurred adding or removing the task, and the returned error message describes the cause. The first eight characters of the error message contain the error message ID.

Resolving the problem

Errors can originate with the stored procedure itself or with the administrative task scheduler, in which case the error information is transmitted back to the stored procedure for output. Most error messages are clearly in one category or the other. For example, DSNA650I csect-name CANNOT CONNECT TO ADMIN SCHEDULER proc-name indicates an error from the stored procedure. DSNA652I csect-name THE USER user-name IS NOT ALLOWED TO ACCESS TASK task-name belongs to the administrative task scheduler, which is checking the parameters and authorization information passed to it.

Understanding the source of the error should be enough to correct the cause of the problem. Most problems are incorrect usage of the stored procedure or an invalid configuration.

Correct the underlying problem and resubmit the call to the stored procedure to add or remove the task.