SET_ID function for RRSAF
The RRSAF SET_ID function sets a new value for the client program ID that can be used to identify the user. The function then passes this information to Db2 when the next SQL request is processed.
The following diagram shows the syntax of the SET_ID function.
Parameters point to the following areas:
- function
- An 18-byte area that contains SET_ID followed by 12 blanks.
- program-id
- An 80-byte area that contains the caller-provided string to be
passed to Db2. If program-id is
less than 80 characters, you must pad it with blanks on the right
to a length of 80 characters.
Db2 places the contents of program-id into IFCID 316 records, along with other statistics, so that you can identify which program is associated with a particular SQL statement.
- retcode
- A 4-byte area in which RRSAF places the return code.
This parameter is optional. If you do not specify retcode RRSAF places the return code in register 15 and the reason code in register 0.
- reascode
- A 4-byte area in which RRSAF places the reason code.
This parameter is optional. If you do not specify reascode, RRSAF places the reason code in register 0.
If you specify reascode, you must also specify retcode.
Example of RRSAF SET_ID calls
The following table shows a SET_ID call in each language.
Language | Call example |
---|---|
Assembler |
|
C1 |
|
COBOL |
|
Fortran |
|
PL/I1 |
|
- For C, C++, and PL/I applications, you must include the appropriate compiler directives, because DSNRLI is an assembler language program. These compiler directives are described in the instructions for invoking RRSAF.