Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Drawbacks to Variable Length Fields

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Drawbacks to Variable Length Fields

    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. Chris

  • #2
    Drawbacks to Variable Length Fields

    Yes, I am talking varlen in the DDS. No max listed. 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. 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.

    Comment


    • #3
      Drawbacks to Variable Length Fields

      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? 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). Chris

      Comment


      • #4
        Drawbacks to Variable Length Fields

        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?

        Comment


        • #5
          Drawbacks to Variable Length Fields

          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.

          Comment


          • #6
            Drawbacks to Variable Length Fields

            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? Thanks. Karen

            Comment

            Working...
            X