• Subject: Re: Why use variable length fields?
  • From: "Simon Coulter" <shc@xxxxxxxxxxxxxxxxx>
  • Date: Tue, 18 Jul 00 12:55:31 +1000

Œ
Hello Joe,

You wrote:
> It looks to me like it is actually taking up more space than if I just left
> FLD1 at 100 without the varlen.
> What am I missing?

You are missing the fact that record length and buffer length refer to the size 
from a 
program's point of view rather than the database's view.

Before VARCHAR fields there was no difference.  Now the space occupied on DASD 
by a 
single record could be considerably less than the record length seen by a 
program.

Much like DATE, TIME, and TIMESTAMP fields.  DSPFFD shows the buffer size, not 
the actual 
size -- hence all the arguments about those data types ocupying more storage 
than the 
old-fashioned numeric date and time fields.

DSPFFD also doesn't show the overhead bytes used to implement the linkage 
between the 
allocated length and any overflow.

Search the archives.  I've sent stuff on VARCHAR fields before.

Regards,
Simon Coulter.

«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»
«» FlyByNight Software         AS/400 Technical Specialists       «»
«» Eclipse the competition - run your business on an IBM AS/400.  «»
«»                                                                «»
«» Phone: +61 3 9419 0175      Mobile: +61 0411 091 400           «»
«» Fax:   +61 3 9419 0175      mailto: shc@flybynight.com.au      «»
«»                                                                «»
«» Windoze should not be open at Warp speed.                      «»
«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»
//--- forwarded letter -------------------------------------------------------
> X-Mailer: Internet Mail Service (5.5.2650.21)
> Date: Mon, 17 Jul 2000 16:39:20 -0400
> From: "Joe Giusto" <JGiusto@patuxent.com>
> To: "'MIDRANGE-L@midrange.com'" <MIDRANGE-L@midrange.com>
> Reply-To: MIDRANGE-L@midrange.com
> Subject: Why use variable length fields?

> 
> So I set up a test with 2 fields and then do a DSPFFD and here is what I
> get:
> 
> Number of fields  . . . . . . . . . . . . . :      2
> 
>    Record length . . . . . . . . . . . . . . . :    103
> 
>  Field Level Information
> 
>               Data        Field  Buffer    Buffer        Field    Column
> 
>    Field      Type       Length  Length  Position        Usage    Heading
> 
>    FLD1       CHAR          100     102         1        Both     FLD1
> 
>      Variable length field -- Allocated length :     30
> 
>      Coded Character Set Identifier  . . . . . :     37
> 
>    FLD2       CHAR            1       1       103        Both     FLD2
> 
>      Coded Character Set Identifier  . . . . . :     37
> 
>  
> Bottom

+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.