PreviousNext
Help > FAQ and miscellaneous > Recovering IP address of PC
Recovering IP address of PC

 The following CL program call LNCOPEN to receive 5250 emulated PC IP address for the current job.

 

In input :

&HANDLE = ‘*GETDOT’

&SVRADDR = ‘*DEV’

 

In output :

&SVRADDR = PC IP address

 

PGM

/* VARIABLES USED TO OPEN COMMUNICATIN AND SEND COMMANDS ...*/

 DCL  VAR(&SVRADDR) TYPE(*CHAR) LEN(30)

 DCL  VAR(&HANDLE) TYPE(*CHAR) LEN(50)

 DCL  VAR(&CCSID) TYPE(*CHAR) LEN(10)

 

/* CALL LNCOPEN WITH &HANDLE=*GETDOT, &SVRADDR=*DEV */

 CHGVAR VAR(&SVRADDR) VALUE(*DEV)

 CHGVAR VAR(&HANDLE) VALUE(*GETDOT)

 CHGVAR VAR(&CCSID) VALUE(*JOB)

 CALL  PGM(LNCOPEN) PARM(&HANDLE &SVRADDR &CCSID)

 

/* ON RETURN, &SVRADDR=IP ADDRESS */

END:

 SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) +

     MSGDTA(&SVRADDR) MSGTYPE(*COMP)

ENDPGM