|
They dropped that sign digit years ago. SEU on V5.2 and earlier still thinksits
32k but you can just ignore that error. I know it worked on V4R5 as this just
compiled:
D myVar32 S 32766A Varying
D myVar64 S 65535A Varying
D I S 10I 0
C EVAL *INLR = *ON
/free
for i = 1 to %size(myVar32) - 2;
%subst(myVar32:i:1) = ' ';
endfor;
for i = 1 to %size(myVar64) - 2;
%subst(myVar32:i:1) = ' ';
endfor;
-Bob Cozzi
www.i5PodCast.com
Ask your manager to watch i5 TV
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On
Behalf Of Vernon Hamberg
Sent: Saturday, May 12, 2007 8:18 PM
To: RPG programming on the AS400 / iSeries
Subject: RE: Max length of a VARYING field
Joe
The current 32K limit might be cuz they are treating the number as signed.
Vern
At 10:25 AM 5/12/2007, you wrote:
From: Barbara Morris
Thanks for your thoughts on this, Scott. We have thought about
VARYING4, but we would want to allow the explicit VARYING2 as well, and
we think that it's more clear that VARYING and VARYING(2) are equivalent
than that VARYING and VARYING2 are equivalent. The concept of a default
parameter is common in RPG, but VARYING2 looks like it means something
different from VARYING.
Ultimately, people have to know what the syntax means anyway, but I
agree that it's ideal if someone reading the code can guess right about
what it means.
Okay, how about something straightforward:
VARYING(*MAX32KB)
VARYING(*MAX2GB)
VARYING(*MAX128TB)
The numbers are based on 2, 4 and 6 byte prefixes, but with one bit unused
(not sure why one bit is unused, except that 32KB is the current maximum, so
I kept the pattern going).
Let VARYING default to VARYING(*MAX32KB) and all is well.
I stopped at 48-bit addressing (technically 47-bit) because it's just hard
for me to conceive of a situation where one would need more than 128
terabytes for a single field. If you decided to go to 63 bits, I guess you
do *MAX8EB (eight exabytes).
Joe
--
This is the RPG programming on the AS400 / iSeries (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 AS400 / iSeries (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 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.