DSNH4785I E csect-name LINE line-number COL column number THE DECLARATION OR USE OF THE SQLSTATE OR SQLCODE VARIABLE IS NOT VALID

Explanation

The use of SQLCODE or SQLSTATE in an SQL routine body is invalid for one of the following reasons:

  • SQLCODE or SQLSTATE was specified as a parameter name.
  • SQLCODE is not declared as INTEGER in a return-codes-declaration clause.
  • SQLSTATE is not declared as CHAR(5) in a return-codes-declaration clause.
  • SQLCODE or SQLSTATE is assigned the value NULL.
csect-name
The name of the control section that issued the message.
line-number and column number
The location of the error in the source program.

System action

The statement cannot be processed.

User response

Declare SQLSTATE only as CHAR(5) and SQLCODE only as INTEGER. Do not assign the null value to SQLCODE or SQLSTATE. Do not use SQLCODE or SQLSTATE as parameter names.

Severity

8 (error)