Program LNCGETKW gets the value associated with a keyword on return of a call to LNCCMD.
This program can also convert a number stored in character format in a variable, into packed or zoned decimal format.
Syntax
DCL |
VAR(&HANDLE) TYPE(*CHAR) LEN(50) |
DCL |
VAR(&PARM1) TYPE(*CHAR) LEN(512) |
DCL |
VAR(&KEYW) TYPE(*CHAR) LEN(...) |
DCL |
VAR(&VALUE) TYPE( . . . |
DCL |
VAR(&FORMAT) TYPE(*CHAR) LEN(10) |
|
|
CALL |
PGM(LNCGETKW) PARM(&HANDLE &PARM1 + &KEYW &VALUE &FORMAT) |
Parameters
Parameters |
|
&PARMX |
Variable &PARMX contains the value returned by a previous call to LNCCMD.
|
&KEYW |
&KEYW
contains the keyword for witch we want to get the value. Example: CHGVAR VAR(&KEYW) VALUE('Pattern;') If
the first character of &KEYW is an asterix (*), then the next characters
represent a data format, in the form : Tn.d . Example: CHGVAR VAR(&KEYW) VALUE('*P8.2 ')
|
&VALUE |
Variable where the value associated to the keyword must be stored.
|
&FORMAT |
Format
of parameter &VALUE, in the form : Tn.d If &FORMAT is absent, variable &VALUE is considered as character type, and its size will be not controlled. . |
|
|
Example
DCL VAR(&SBJ)
TYPE(*CHAR) LEN(50)
DCL VAR(&SND) TYPE(*CHAR) LEN(50)
...
CALL PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1
&PARM2 &RES)
/* Here &RES contains: */
/* 'Subject="My message";SenderName="Accounting service"'
*/
CALL PGM(LNCGETKW) PARM(&HANDLE &RES 'Subject ' &SBJ 'A50')
CALL PGM(LNCGETKW) PARM(&HANDLE &RES 'SenderName ' &SND 'A50')
/* After the calls: */
/* &SBJ = 'My message' */
/* &SND = 'Accounting service' */