×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

-READ length of variables

-READ length of variables

-READ length of variables

(OP)
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:


TABLE FILE NAMES         
 PRINT COMP_NAME COMP_ID         
       DEP_NAME DEP_ID       
 WHERE ID EQ '25'
ON TABLE HOLD AS COMPDEP   
END                          


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:


-DEFAULTS &VCOMPN = '';
-DEFAULTS &VCOMPI = '';
-DEFAULTS &VDEPN = '';
-DEFAULTS &VDEPI = '';

-READ COMPDEP &VCOMPN.A3. &VCOMPI.I6. &VDEPN.A3. &VDEPI.I6.


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

RE: -READ length of variables

Hi kaeserea,

you'll need to either HOLD FORMAT ALPHA or SAVE as the I6 fields are being held in internal format.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close