I have a QCMDSRC command source with following fields -
PARM KWD(FIELD1) TYPE(MYOWNTYPE) MIN(0) MAX(5)
MYOWNTYPE: ELEM1 TYPE(*NAME) LEN(10) MIN(1)
ELEM2 TYPE(*INT4) RANGE(1 99999)
ELEM3 TYPE(*INT4) VALUES(100 200)
As you can see, a FIELD1 of type MYOWNTYPE and that MYOWNTYPE has 3 elements in it - 1 of NAME type and 2 of INT4 type
Now, i am developing a CL program in which I will have to invoke the command. So, i am defining my CL program as -
DCL VAR(&FIELD1) TYPE(*CHAR) LEN(100)
DCL VAR(&ELEM1) TYPE(*CHAR) STG(*DEFINED) LEN(10) DEFVAR(&FIELD1 1)
DCL VAR(&ELEM2) TYPE(*INT) STG(*DEFINED) LEN(4) DEFVAR(&FIELD1 11)
DCL VAR(&ELEM3) TYPE(*INT) STG(*DEFINED) LEN(4) DEFVAR(&FIELD1 15)
CHGVAR VAR(&FIELD1) VALUE(&FILEFIELD1) // Assigning file field1 which is of character length 10 to field1 variable which is of CHAR type
CHGVAR VAR(&FIELD2) VALUE(&FILEFIELD2) // Assigning file field2 which is of character length 4 to field2 variable which is of INT type
CHGVAR VAR(&FIELD3) VALUE(&FILEFIELD3) // Assigning file field3 which is of character length 4 to field3 variable which is of INT type
But, when i perform QCMDEXC on command string, it fails. Can someone guide me what i am making wrong here? Is the problem with the
1. *INT field definitions in CL program or
2. with the CL data structure usage or
3. with the way CHGVAR is performed in CL program?
PARM KWD(FIELD1) TYPE(MYOWNTYPE) MIN(0) MAX(5)
MYOWNTYPE: ELEM1 TYPE(*NAME) LEN(10) MIN(1)
ELEM2 TYPE(*INT4) RANGE(1 99999)
ELEM3 TYPE(*INT4) VALUES(100 200)
As you can see, a FIELD1 of type MYOWNTYPE and that MYOWNTYPE has 3 elements in it - 1 of NAME type and 2 of INT4 type
Now, i am developing a CL program in which I will have to invoke the command. So, i am defining my CL program as -
DCL VAR(&FIELD1) TYPE(*CHAR) LEN(100)
DCL VAR(&ELEM1) TYPE(*CHAR) STG(*DEFINED) LEN(10) DEFVAR(&FIELD1 1)
DCL VAR(&ELEM2) TYPE(*INT) STG(*DEFINED) LEN(4) DEFVAR(&FIELD1 11)
DCL VAR(&ELEM3) TYPE(*INT) STG(*DEFINED) LEN(4) DEFVAR(&FIELD1 15)
CHGVAR VAR(&FIELD1) VALUE(&FILEFIELD1) // Assigning file field1 which is of character length 10 to field1 variable which is of CHAR type
CHGVAR VAR(&FIELD2) VALUE(&FILEFIELD2) // Assigning file field2 which is of character length 4 to field2 variable which is of INT type
CHGVAR VAR(&FIELD3) VALUE(&FILEFIELD3) // Assigning file field3 which is of character length 4 to field3 variable which is of INT type
But, when i perform QCMDEXC on command string, it fails. Can someone guide me what i am making wrong here? Is the problem with the
1. *INT field definitions in CL program or
2. with the CL data structure usage or
3. with the way CHGVAR is performed in CL program?
Comment