× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



David,

The difference is that the space used in the overflow space is
variable. So if you only have 10 characters in a 200 charactor
varying field with ALLOCATE(0) you're only using 10 bytes in the
overflow space.

Again teh regular data space used per record is fixed, the overflow
space used (if any) is variable.

Thus you only use the overflow space you need.

Charles

On Wed, Sep 16, 2009 at 9:26 AM, David FOXWELL <David.FOXWELL@xxxxxxxxx> wrote:
Guys, your explications are perfectly clear and I thank you for them.

However what I was getting at was if I have ALLOCATE(0) for maximum space saving, how do I save space? Is not the data in the overflow plus that of the file not equal to or more than the disk space used without VARLEN? The overflow space must occupy something, somewhere. Or is it just some kind of black hole?


-----Message d'origine-----
De : rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] De la part de Charles Wilt
Envoyé : mercredi 16 septembre 2009 15:19
À : RPG programming on the IBM i / System i
Objet : Re: Use of VARYING fields

On Wed, Sep 16, 2009 at 8:18 AM, Simon Coulter
<shc@xxxxxxxxxxxxxxxxx> wrote:

On 16/09/2009, at 7:13 PM, David FOXWELL wrote:


After having read up, I have a couple of questions. If you
don't care
about space saving, can't you just code the maximum and allocated
length as the same?

Yes, but what would be the point? That would effectively be
a fixed-
length field with an additional 2-byte length prefix. Might make it
easier to determine actual length of the content but that's all.

Simon,

The point would be, you'd benefit from not having to %trimr()
the fields yet don't pay a i/o hit when accessing any records.

I'd consider such a field as an alternative to a small (say
<50) fixed length field.  Particularly in a table access by
native RPG op-codes.
Otherwise you're taking a dual i/O hit for some records even
if you don't need the variable length field.  Of course, an
alternative would be to have a logical that didn't include
the varying field(s).

Charles Wilt
--
This is the RPG programming on the IBM i / System i
(RPG400-L) mailing list To post a message email:
RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change
list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.


--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.