Here's the deal, (you might want to light up a number before reading any
further), you have to manually set that before you can read it.
From the documentation at
https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/db2/rbafzcurclws.htm
<snip>
The default value of this register is the empty string. The value of the
workstation name can be changed through these interfaces:
The Set Client Information (SQLESETI) API can change the client
special register.
The SYSPROC.WLM_SET_CLIENT_INFO procedure can change the client
special register.
In CLI, SQLSetConnectAttr() can be used to set the
SQL_ATTR_INFO_WRKSTNNAME connection attribute.
In ODBC, SQLSetConnectAttr() can be used to set the
ODBC_ATTR_INFO_WRKSTNNAME connection attribute.
In JDBC, the setClientInfo connection method can be used to set the
ClientHostName connection property.
</snip>
Yep, I think I opened up a SR on that because it was coming with the
system name. IBM changed the default to the subsystem name (see APAR
SE64212)
http://www-01.ibm.com/support/docview.wss?uid=nas3SI59856
Keep in mind that some of the "built-in global variables" mentioned at
https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_73/db2/rbafzgvars.htm
do not have to be prefixed with the schema name if they are in your
library list, like QSYS2 is
values qsys2.job_name
and
values job_name
both work.
But others are in sysibm and you must prefix them. Like
values sysibm.client_host
and
values sysibm.client_ipaddr
Rob Berendt
As an Amazon Associate we earn from qualifying purchases.