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



Right, I pulled that code together and compiled it but didn't run it.
Yes, they switched from a signed-int to an unsigned int sometime in V4rx days.
This code was to illustrate that you can declare a 64k variable.
Use this in place of the %subst() if you want it to run:

myVar32 += ' ';

-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 vhamberg@xxxxxxxxxxx
Sent: Monday, May 14, 2007 11:25 AM
To: RPG programming on the AS400 / iSeries
Subject: RE: Max length of a VARYING field

Bob

Are we talking about the same thing? I was referring to the possibility that the
system is reading the length bytes as a signed integer vs an unsigned one - that
is, as you know, managed with the leftmost bit - not byte.

That compiled for me at V5R1 but I get an RNQ0100 "Length or start position is
out of range for the string operation" at runtime.

Vern
-------------- Original message --------------
From: "Bob Cozzi" <bob@xxxxxxxxxxxx>

They dropped that sign digit years ago. SEU on V5.2 and earlier still thinks
its
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 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.