PreviousNext
Help > Programming with LAUNCHER Office > Advanced programming > API Programs with AS400 client > LNCOPEN - API Program
LNCOPEN - API Program

Open communication between AS/400 and a PC.

 

LAUNCHER Office demon must be launched on the target PC.

 

 

Syntax

 

DCL

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

DCL

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

DCL

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

 

 

CHGVAR

VAR(&HANDLE) VALUE('*ONLY')

CHGVAR

VAR(&SRVADDR) VALUE('*DEV')

CHGVAR

VAR(&CCSID) VALUE('*JOB')

 

 

CALL

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

MONMSG

MSGID(LNC0000) EXEC(GOTO CMDLBL(ERROR))

 

Parameters

  

Parameters

 

HANDLE  (E/S)

Descriptor returned by LNCOPEN function. This variable will be used with all LAUNCHER Office functions.
If a single communication is opened to the PC, &HANDLE variable *ONLY will be used to initialise.
Special value *GETDOT allows to recover PC TCP/IP address in SVDADDR parameter.

SVRADDR (E/S)

PC network name or TCP/IP address.
Use *DEV value to name the terminal emulated PC where the current interactive session is opened.
If HANDLE parameter value is *GETDOT, SVRADDR will return the PC TCP/IP address.

CCSID (E)

CCSID is used by AS/400 programs.

Set this value to *JOB to use current job CCSID.

 

Note

From OS/400 version V3R7 (CUMUL C8069370) AS/400 DEVICE may be used to recover emulation IP address.

Specifying *DEV as target address, allows conversation between the program and emulated PC.

 

In order to use LAUNCHER Office in a « Batch » job communicating with user's PC, the interactive program must :

- Recover PC address, using HANDLE=*GETDOT, and SVRADDR=*DEV

- Submit the « Batch » job by transferring the received SVRADDR parameter value to the program.

 

Example

 

Open a conversation with the interactive user's PC.

 

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

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

 DCL VAR(&CCSID) TYPE(*CHAR) LEN(10) VALUE(‘*JOB’)

 . . .

CHGVAR VAR(&SVRADD) VALUE('*DEV')

CHGVAR VAR(&HANDLE) VALUE(*ONLY')

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

MONMSG MSGID(LNC0000) EXEC(GOTO CMDLBL(ERROR))

 

Open a conversation with the PC to address “182.12.13.14”

 

. . .  

CHGVAR VAR(&SVRADD) VALUE('182.12.13.14')

CHGVAR VAR(&HANDLE) VALUE(*ONLY')

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

MONMSG MSGID(LNC0000) EXEC(GOTO CMDLBL(ERROR))

 

Recover interactive user's PC IP address.

 

. . .  

CHGVAR VAR(&SVRADD) VALUE(*DEV')

CHGVAR VAR(&HANDLE) VALUE(*GETDOT')

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

/*&SVRADDR contains the IP address in return. */