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.
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
>>-WLM_SET_CLIENT_INFO--(--+-client_userid-+--,--+-client_wrkstnname-+--,--> '-NULL----------' '-NULL--------------' >--+-client_applname-+--,--+-client_acctstr-+--)--------------->< '-NULL------------' '-NULL-----------'
The schema is SYSPROC.
Procedure parameters
- client_userid
- An input argument 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 16 bytes, it is truncated to 16 bytes. If the value specified is less than 16 bytes, it is padded on the right with blanks to a length of 16 bytes.
- client_wrkstnname
- An input argument 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.
If the value specified exceeds 18 bytes, it is truncated to 18 bytes. If the value specified is less than 18 bytes, it is padded on the right with blanks to a length of 18 bytes.
- client_applname
- An input argument 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.
If the value specified exceeds 32 bytes, it is truncated to 32 bytes. If the value specified is less than 32 bytes, it is padded on the right with blanks to a length of 32 bytes.
- client_acctstr
- An input argument 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.
If the requester is DB2 for z/OS, and the value that is specified exceeds 142 bytes, it is truncated to 142 bytes. Otherwise, if the value specified exceeds 200 bytes, it is truncated to 200 bytes.
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);