Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

-READ length of variables

Status
Not open for further replies.

kaeserea

Programmer
Feb 26, 2003
164
DE
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
 
Hi kaeserea,

you'll need to either HOLD FORMAT ALPHA or SAVE as the I6 fields are being held in internal format.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top