WLM_SET_CLIENT_INFO stored procedure

This procedure allows the caller to set client information that is associated with the current connection at the Db2 for z/OS® server.

The following Db2 for z/OS client special registers can be changed:

  • CURRENT CLIENT_ACCTNG
  • CURRENT CLIENT_USERID
  • CURRENT CLIENT_WRKSTNNAME
  • CURRENT CLIENT_APPLNAME

The existing behavior of the CLIENT_ACCTNG register is unchanged. It gets its value from the accounting token for DSN requesters, and from the accounting string for SQL and other requesters.

Setting the CLIENT_ACCTNG special register updates the suffix portion of the accounting string. The accounting suffix information is limited to 255 bytes for distributed clients

This procedure is not under transaction control and client information changes made by the procedure are independent of committing or rolling back units of work.

Environment

WLM_SET_CLIENT_INFO runs in a WLM-established stored procedures address space.

Authorization

To execute the CALL statement, the owner of the package or plan that contains the CALL statement must have one or more of the following privileges on each package that the stored procedure uses:

  • The EXECUTE privilege on the package for DSNADMSI
  • Ownership of the package
  • PACKADM authority for the package collection
  • SYSADM authority

Syntax

Read syntax diagramSkip visual syntax diagram WLM_SET_CLIENT_INFO ( client_useridNULL , client_wrkstnnameNULL , client_applnameNULL , client_acctstrNULL )

The schema is SYSPROC.

Procedure parameters

client_userid
An input parameter of type VARCHAR(255) that specifies the user ID for the client. If NULL is specified, the value remains unchanged. If an empty string (") is specified, the user ID for the client is reset to the default value.

If the value specified exceeds 128 bytes, it is truncated to 128 bytes.

client_wrkstnname
An input parameter of type VARCHAR(255) that specifies the workstation name for the client. If NULL is specified, the value remains unchanged. If an empty string (") is specified, the workstation name for the client is reset to the default value.
client_applname
An input parameter of type VARCHAR(255) that specifies the application name for the client. If NULL is specified, the value remains unchanged. If an empty string (") is specified, the application name for the client is reset to the default value.
client_acctstr
An input parameter of type VARCHAR(255) that specifies the accounting string for the client. If NULL is specified, the value remains unchanged. If an empty string (") is specified, the accounting string for the client is reset to the default value.

Examples

Set the user ID, workstation name, application name, and accounting string for the client.

strcpy(user_id, "db2user"); 
strcpy(wkstn_name, "mywkstn"); 
strcpy(appl_name, "db2bp.exe");   
strcpy(acct_str, "myacctstr"); 
iuser_id    = 0;
iwkstn_name = 0; 
iappl_name  = 0;  
iacct_str   = 0;    
EXEC SQL CALL SYSPROC.WLM_SET_CLIENT_INFO(:user_id:iuser_id, :wkstn_name:iwkstn_name, 
                                          :appl_name:iappl_name, :acct_str:iacct_str);

Set the user ID to db2user for the client without setting the other client attributes.

strcpy(user_id, "db2user");
iuser_id    = 0;
iwkstn_name = -1; 
iappl_name  = -1;  
iacct_str   = -1;    
EXEC SQL CALL SYSPROC.WLM_SET_CLIENT_INFO(:user_id:iuser_id, :wkstn_name:iwkstn_name, 
                                          :appl_name:iappl_name, :acct_str:iacct_str);

Reset the user ID for the client to blank without modifying the values of the other client attributes.

strcpy(user_id, "");
iuser_id    = 0;
iwkstn_name = -1; 
iappl_name  = -1;  
iacct_str   = -1;    
EXEC SQL CALL SYSPROC.WLM_SET_CLIENT_INFO(:user_id:iuser_id, :wkstn_name:iwkstn_name, 
                                          :appl_name:iappl_name, :acct_str:iacct_str);