Retrieve IP with RPGLE
H DFTACTGRP(*NO) BNDDIR('QC2LE')
*
D GetIpAdr PR * extproc('QDCRDEVD')
D Revlen 4B 0 Inz(5000)
D Format 8A Inz('DEVD0600')
D Device 10A
D ApierrPtr *
*
D ReivDs DS BASED(ReivarPtr)
D Reivar 1000A Inz
D ReivarPtr S *
*
D Apierr DS BASED(ApierrPtr)
D Bytprv 1 4B 0
D Bytavl 5 8B 0
D Errorid 9 15A
D Reserved 16 16A
D ErrorDesc 17 216A
*
D ApierrPtr S *
D I_Net_Adr S 16a Inz
D Revlen S 4B 0 Inz(5000)
D Format S 8A Inz('DEVD0600')
*
D SDS
D Device 244 253
* 这里取本地终端的设备号的IP
* 设备号也可以用*entry传入,如用wrkactjob、或wrkobjlck查看到的设备号。
*---------------------------------------------------------
* Retrieve IP Address
/free
ReivarPtr = GetIpAdr(RevLth:Device:Format:ApierrPtr);
If BytAvl = 0;
I_Net_Adr = %subst(Reivar:878:15);
EndIf;
Dsply I_Net_Adr;
*Inlr = *On
/end-free
阅读(1618) | 评论(0) | 转发(1) |