MC Press Online Forum
Welcome, Guest
Please Login or Register.    Lost Password?
Drawbacks to Variable Length Fields (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Drawbacks to Variable Length Fields
#73370
Guest.Visitor (Visitor)

Birthdate:
Drawbacks to Variable Length Fields 10 Months, 2 Weeks ago  
Are you talking about using VARLEN(max) keyword in DDS? If so, then when a field length exceeds the max you specify, it spills over into some sort of a parallel file. So, reading the part description might be 2 file reads instead of 1. At least, that's my understanding. DASD is cheap so I'm not sure how often VARLEN is used. <p>Chris
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#73371
Guest.Visitor (Visitor)

Birthdate:
Drawbacks to Variable Length Fields 10 Months, 2 Weeks ago  
Yes, I am talking varlen in the DDS. No max listed. <p>This file will be used for employee application tracking. I will have a comment field that has a 1000 character limit but may be blank. <p>I have no issue with a 2nd file read. Just want to make sure it will work the same as all the other fields in something like query and that it isn't ignored or not seen.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#73372
Guest.Visitor (Visitor)

Birthdate:
Drawbacks to Variable Length Fields 10 Months, 2 Weeks ago  
I believe if you do NOT specify a max length in the primary file VARLEN field, then all data for that field is stored in the variable length portion of the file. Not saying that's a problem, just that is how it supposedly works. But if 100% spills over into 2nd file, what's the point of using VARLEN? <p>And using VARLEN increases the record length a few dozen bytes, to save the data length in each field (similar to a VARYING field in RPG). <p>Chris
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#73373
Guest.Visitor (Visitor)

Birthdate:
Drawbacks to Variable Length Fields 10 Months, 2 Weeks ago  
Comments may exist for only 10% of applicants. Rather than a secondary file which would require a key, I thought I'd use a VARLEN field that would not exist unless comments were entered. Am I better off with another file?
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#73374
lujate (User)
Junior Boarder
Posts: 25
graphgraph
User Offline Click here to see the profile of this user
Drawbacks to Variable Length Fields 10 Months, 2 Weeks ago Karma: 0  
I would go with the variable length column, specifying the amount of space to allocate. The space allocated is always taken up by the row. If the column exceeds that space then additional space is allocated. Considering only 10% of the rows will have a value for that column, I would specify ALLOCATE(0) or VARLEN(0), for DDL and DDS respectively.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#73369
Guest.Visitor (Visitor)

Birthdate:
Drawbacks to Variable Length Fields 10 Months, 2 Weeks ago  
I am creating a file with variable length fields for the 1st time. Are there any drawbacks to variable length fields? Mine will have no defined length as they will frequently be empty. Are there issues with query or any other functions that anybody knows about? <p>Thanks. Karen
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop
   MC-STORE.COM