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.

DSNRLI SET_ID function

Read syntax diagramSkip visual syntax diagramCALL DSNRLI(function, program-id ,retcode,reascode )

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.

Table 1. Examples of RRSAF SET_ID calls
Language Call example
Assembler
CALL  DSNRLI,(SETIDFN,PROGID,RETCODE,REASCODE)
C1
fnret=dsnrli(&setidfn[0], &progid[0], &retcode, &reascode);
COBOL
CALL  'DSNRLI' USING SETIDFN PROGID RETCODE REASCODE.
Fortran
CALL  DSNRLI(SETIDFN,PROGID,RETCODE,REASCODE)
PL/I1
CALL  DSNRLI(SETIDFN,PROGID,RETCODE,REASCODE);
Note:
  1. 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.