CURRENT CLIENT_WRKSTNNAME special register

CURRENT CLIENT_WRKSTNNAME contains the value of the workstation name from the client information that is specified for the connection.

The data type is VARCHAR(255).

The default workstation name varies, depending on the connection:

  • If the connection originates from a Db2 12 for z/OS® requester, it is the client hostname.
  • If the connection is from a remote application client driver, it is the client hostname where the request is submitted. Default values that are set by the IBM® Data Server Driver for JDBC and SQLJ can be obtained from the DatabaseMetaData.getClientInfoProperties method.
  • If the connection is from a remote Db2 12 for z/OS application, the default varies depending on which attachment facility is used:
    TSO attachment facility
    The default workstation name is one of the following cases:
    • The default workstation name is 'TSO' when the application runs in TSO foreground with TSO online applications like SPUFI.
    • The default workstation name is 'BATCH' when the application runs in TSO background with TSO batch applications like DSNTEP2.
    RRS attachment facility interface
    The default workstation name is 'RRSAF
    Call attachment facility
    The default workstation name is 'DB2CALL'.
    CICS® attachment facility
    The default workstation name is the CICS region name.
    IMS Attachment facility
    The default workstation name is IMS region ID.

The value of the special register can be changed by using one of the following application programming interfaces (APIs):

  • SQLE_CLIENT_INFO_WRKSTNNAME (sqleseti)
  • SQLSetConnectAttr (ODBC)
  • java.sql.Connection.setClientInfo (JDBC)
  • The RRS DSNRLI SIGNON, AUTH SIGNON, CONTEXT SIGNON, or SET_CLIENT_ID function
  • The WLM_SET_CLIENT_INFO stored procedure

When the client workstation name is explicitly set, it overwrites the default workstation name described above and is used as the client workstation name.

The application compatibility value of the package determines the length and blank padding of the CURRENT CLIENT_WRKSTNNAME special register returned.

If one of these APIs is not used to set the value of the special register, an empty string is returned when the special register is referenced.

Example: Get the name of the workstation that is being used in this connection.
  SET :WS_NAME = CURRENT CLIENT_WRKSTNNAME