Hello!
I create a hold file from which I get a single row of data. I then use the -READ command to put the field values into one variable each.
Unfortunately the field values are cut off in the variables. Can anybody help me?
Here's the code:
1.) generate the hold file:
[tt]
TABLE FILE NAMES
PRINT COMP_NAME COMP_ID
DEP_NAME DEP_ID
WHERE ID EQ '25'
ON TABLE HOLD AS COMPDEP
END
[/tt]
The fields have the following format:
COMP_NAME: A3
COMP_ID: I6
DEP_NAME: A3
DEP_ID: I6
2.) this returns only one line of data with the following values:
COMP_NAME: AB
COMP_ID: 5
DEP_NAME: XYZ
DEP_ID: 16
3.) I then try to put these values into variables with the -READ command:
[tt]
-DEFAULTS &VCOMPN = '';
-DEFAULTS &VCOMPI = '';
-DEFAULTS &VDEPN = '';
-DEFAULTS &VDEPI = '';
-READ COMPDEP &VCOMPN.A3. &VCOMPI.I6. &VDEPN.A3. &VDEPI.I6.
[/tt]
What I then get is
&VCOMPN = AB
&VCOMPI = zX
&VDEPN = YZ
&VDEPI =
(where the z is one with a v on top)
Somehow the fields are shortened and the rest is not filled into the variables.
Can somebody tell me where I make a mistake?
Thanx
Eva
I create a hold file from which I get a single row of data. I then use the -READ command to put the field values into one variable each.
Unfortunately the field values are cut off in the variables. Can anybody help me?
Here's the code:
1.) generate the hold file:
[tt]
TABLE FILE NAMES
PRINT COMP_NAME COMP_ID
DEP_NAME DEP_ID
WHERE ID EQ '25'
ON TABLE HOLD AS COMPDEP
END
[/tt]
The fields have the following format:
COMP_NAME: A3
COMP_ID: I6
DEP_NAME: A3
DEP_ID: I6
2.) this returns only one line of data with the following values:
COMP_NAME: AB
COMP_ID: 5
DEP_NAME: XYZ
DEP_ID: 16
3.) I then try to put these values into variables with the -READ command:
[tt]
-DEFAULTS &VCOMPN = '';
-DEFAULTS &VCOMPI = '';
-DEFAULTS &VDEPN = '';
-DEFAULTS &VDEPI = '';
-READ COMPDEP &VCOMPN.A3. &VCOMPI.I6. &VDEPN.A3. &VDEPI.I6.
[/tt]
What I then get is
&VCOMPN = AB
&VCOMPI = zX
&VDEPN = YZ
&VDEPI =
(where the z is one with a v on top)
Somehow the fields are shortened and the rest is not filled into the variables.
Can somebody tell me where I make a mistake?
Thanx
Eva