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



Joe Pluta wrote:
...
One option is to have ALL fields have a 48-bit index, and then we wouldn't
have to specify the index size -- that was the "adds overhead for everybody"
option. Or we can go with the extra keyword on the VARYING clause. That's
a different kind of overhead: it adds an unnecessary keyword. Talk about
making the language harder to teach! Just try explaining why you would
specify a *MAX4GB value for a field with a defined maximum length of 2KB.


You are right that it's a bit loony to say the field has a maximum length of 10, and that it also has a maximum length of *MAX4GB. But that just shows that the *MAX4GB form of specifying the size doesn't really work. Specifying prefix size as 2 or 4 doesn't say anything about the maximum length; it only says how big the storage is for the prefix.

If the prefix size changed from one release to the next, there would be chaos even if all RPG programs were recompiled. There are more ways to specify a "variable with a 2-byte prefix indicating the length" than just RPG's VARYING type. In C, you have to use a struct with a short-unsigned length; COBOL too. In a command PARM, you say VARYING(*YES:*INT2). RPG data structures may have a dependency on the size of the varying prefix. Etc, etc. There's no way IBM would make a change that would cause programmers to have locate and recode all the places that were interfacing with varying fields.

(Aside: where did the 48-bit prefix come from? That's 6 bytes; did I miss something?)


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.