如何從 AS/400 判斷 TCP/IP 的連線終端機的 IP address ?
/* OS/400 CONFIGURATION APIS V4R3 SC41-5853-02 */
/* */
/* RETRIEVE DEVICE DESCRIPTION (QDCRDEVD) API */
/* HTTP://PUBLIB.BOULDER.IBM.COM/CGI-BIN/BOOKMGR/BOOKS/QB3AM302/1.6 */
/* */
PGM (&DEVICENAME)
/******************************/
/* PARAMETERS */
/******************************/
DCL &DEVICENAME *CHAR 10
DCL &DEVCLS *CHAR 10
DCL &IPADDRESS *CHAR 15
DCL &RTNVAL *CHAR 256
DCL &RTNPOS *DEC 3 0
/******************************/
/* PARAMETERS FOR QDCRDEVD */
/******************************/
DCL &RECEIVER *CHAR 892
DCL &RCVRLENGTH *CHAR 4
DCL &FORMATNAME *CHAR 8 'DEVD0600' /* THE FORMAT FOR DISPLAY DEVICES */
DCL &ERRORCODE *CHAR 4 X'00000000' /* USE NORMAL ERROR HANDLING */
/******************************/
/* SET LENGTH OF RECEIVER */
/******************************/
CHGVAR %BIN(&RCVRLENGTH) 892
/******************************/
/* GET DEVICE INFO */
/******************************/
CALL PGM(QDCRDEVD) PARM(&RECEIVER &RCVRLENGTH +
&FORMATNAME &DEVICENAME &ERRORCODE)
CHGVAR &IPADDRESS %SST(&RECEIVER 878 15)
CHGVAR &DEVCLS %SST(&RECEIVER 165 10)
SNDPGMMSG MSG(&DEVCLS *BCAT &DEVICENAME *BCAT ' IP address is ' +
*cat &ipaddress ) MSGTYPE(*COMP)
ENDPGM
PS: 將 TCP/IP 的連線終端機名稱傳入此程式,會傳回連線終端機的 IP address
A blog about IBM i (AS/400), MQ and other things developers or Admins need to know.
星期二, 10月 31, 2023
2000-03-31 如何從 AS/400 判斷 TCP/IP 的連線終端機的 IP address ?
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言