Start of change

SELFCODES global variable

This global variable determines the list of SQLCODEs that are handled by the SQL Error Logging Facility (SELF).

This global variable has the following characteristics:
  • It is updateable.
  • The type is VARCHAR(256).
  • The schema is SYSIBMADM.
  • The scope of this global variable is session.
  • The default value is null, which corresponds to OFF.

The global variable can be set to a string containing up to 32 SQLCODEs with one or more blanks between values.

By default, the READ and WRITE privileges on this global variable are granted to PUBLIC.

To change the value of this global variable within a specific job, the user must have the WRITE privilege.

To replace the default value of the global variable, the user must have the authorizations listed for the CREATE VARIABLE statement, including the OR REPLACE authority. See CREATE VARIABLE.

To confirm that the string value being used with SELFCODES is syntactically correct, use the VALIDATE_SELF scalar function.


Configure SELF to capture detail for all jobs started in the future, for any SQL statements that fail with SQLCODE = -913 or SQLCODE = -204.
      VARCHAR(256) DEFAULT '-913, -204';
End of change