midrange.com code scratchpad |
Name:
iSeries IP / hostname: how to get
|
Scriptlanguage:
Plain Text
|
Tabwidth:
4
|
Date:
01/20/2010 06:41:23 pm
|
IP:
Logged
|
|
Description:
http://publib.boulder.ibm.com/infocenter/iseries/v6r1m0/index.jsp?topic=/apis/qtocrtvtcpa.htm
Use QtocRtvTCPA to get the host name of the system
Member type CLLE
|
Code:
- PGM
- /*http://publib.boulder.ibm.com/infocenter/iseries/v6r1m0/index.jsp?topic=/apis/qtocrtvtcpa.htm*/
- DCL VAR(&hostname) TYPE(*CHAR) LEN(64)
- DCL VAR(&domainname) TYPE(*CHAR) LEN(255)
- DCL VAR(&RCVVAR) TYPE(*CHAR) LEN(512)
- DCL VAR(&APIERR) TYPE(*CHAR) LEN(8) VALUE(X'0000000000000000')
- DCL VAR(&TCPAFORMAT) TYPE(*CHAR) LEN(8) VALUE('TCPA0300')
- DCL VAR(&RCVVARLEN) TYPE(*CHAR) LEN(4)
- DCL VAR(&MSGID) TYPE(*CHAR) LEN(7)
- DCL VAR(&MSGDTA) TYPE(*CHAR) LEN(256)
- DCL VAR(&MSGF) TYPE(*CHAR) LEN(10)
- DCL VAR(&MSGFLIB) TYPE(*CHAR) LEN(10)
- DCL VAR(&MSGTXT) TYPE(*CHAR) LEN(256)
-
- chgvar %Bin(&RcvVarLen) 512
- callprc 'QtocRtvTCPA' ( &RcvVar +
- &RcvVarLen +
- &TCPAFormat +
- &ApiErr)
-
- ChgVar &hostname %SST(&RcvVar 177 64)
- ChgVar &domainname %SST(&RcvVar 241 255)
-
- SNDPGMMSG MSGID(CPF9897) MSGF(QCPFMSG) MSGDTA(&hostname) +
- MSGTYPE(*info )
- SNDPGMMSG MSGID(CPF9897) MSGF(QCPFMSG) MSGDTA(&domainname) +
- MSGTYPE(*info )
- engpgm
|
|
|