Expected output for connection and sign-on routines

Db2 uses the output values of the primary ID, the SQL ID, and the secondary IDs. Your routines can set these IDs to any value that is an SQL short identifier.

Begin program-specific programming interface information.If your identifier does not meet the 8-character criteria, the request fails. Therefore, when necessary, add blanks to the end of short identifiers to ensure that they meet the criteria.

If the values that are returned are not blank, Db2 interprets them in the following ways:

  • The primary ID becomes the primary authorization ID.
  • The list of secondary IDs, down to the first blank entry or to a maximum of 1012 entries, becomes the list of secondary authorization IDs. The space allocated for the secondary ID list is only large enough to contain the maximum number of authorization IDs. This number is in field AIDLSCNT.
    Important: If you allow more than 1012 secondary authorization IDs, abends and storage overlays can occur.
  • The SQL ID is checked to see if it is the same as the primary or one of the secondary IDs. If it is not, the connection or sign-on process fails. Otherwise, the validated ID becomes the current SQL ID.

If the returned value of the primary ID is blank, Db2 takes the following steps:

  • In connection processing, the default ID that is defined when Db2 is installed (UNKNOWN AUTHID on panel DSNTIPP) is substituted as the primary authorization ID and the current SQL ID. The list of secondary IDs is set to blanks.
  • Sign-on processing abends. No default value exists for the primary ID.

If the returned value of the SQL ID is blank, Db2 makes it equal to the value of the primary ID. If the list of secondary IDs is blank, it remains blank. No default secondary IDs exist.

Your routine must also set a return code in word 5 of the exit parameter list to allow or deny access (field EXPLARC). By those means you can deny the connection altogether. The code must have one of the values that are shown in Table 1.
Table 1. Required return code in EXPLARC
Value Meaning
0 Access allowed; continue processing.
12 Access denied; terminate.
Any other value will cause an abend.End program-specific programming interface information.