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

 Program LNCSETKW inserts into variable &PARMx, an expression in the form: 'KeyWord=Value'.

With LNCSETKW make easier the construction of the parameters need for program LNCCMD.

If the keyword already exists in &PARMx, its value is replaced.

 

Syntax

 

DCL

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

DCL

VAR(&PARMX) TYPE(*CHAR) LEN(512)

DCL

VAR(&KEYW) TYPE(*CHAR) LEN(...)

DCL

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

DCL

VAR(&VALUE) TYPE( . . .

DCL

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

 

 

CALL

PGM(LNCSETKW) PARM(&HANDLE &PARMX +

&KEYW &TYPE &VALUE &FORMAT)

 

 

Parameters

 

Parameters

 

&PARMX

&PARMX is the variable to change. This variable will be used in a call to LNCCMD.
When programming in OPM mode (non ILE), variable &PARMX 512.

&KEYW

&KEYW contains the keyword to insert in &PARMX..
The keyword can be inside doubles quotes ("), or, it must be ended by a punctuation character or a blank.

Example: CHGVAR VAR(&KEYW) VALUE('Pattern;') 

If &KEYW is blank, value of parameter &VALUE will be added to &PARMX, with a semicolon before (;) if &PARMX is not empty.

&TYPE

&TYPE is the type of the value given to the keyword.
Possible values are:

*STR: Character string type; Double quotes ("") will be added to the value given in parameter &VALUE.

*DEC: Numeric;

*BOO: Boolean; &VALUE contain value :
'1' or 'T' for True,
'0' or 'F' for False.

*CAT: Value of &VALUE will be concatenated to the value already set in &PARMX for the keyword.

*CLR: The keyword and its value are deleted from &PARMX.

&VALUE

Contains the value to affect to Keyword

&FORMAT

Format of parameter &VALUE, in the form : Tn.d
T is the data type:
A for character.
P for packed decimal
S for zoned decimal.
n is the number of digits or characters in &VALUE.
d is the number of digits after the decimal point for a numeric value.

 

 

 

Example

After the execution of the following code :

CHGVAR  VAR(&PARPM1) VALUE(' ')
CHGVAR  VAR(&KEYW) VALUE('Title ')
CHGVAR  VAR(&TYPE) VALUE('*STR')
CHGVAR  VAR(&VALUE) VALUE('Open a document')
CHGVAR  VAR(&FORMAT) VALUE('A50')
CALL  PGM(LNCSETKW) PARM(&HANDLE &PARM1 +
      &KEYW &TYPE &VALUE &FORMAT)

CALL  PGM(LNCSETKW) PARM(&HANDLE &PARM1 +
      'FileMustExist' '*BOO ' '1')

Variable &PARM1 has value:

 'Title="Open a document";FileMustExist=True'