|
Brad, A warning on large variable length return values. Previous responses I've had on this list by the IBM guys indicate that it appears the compiler has not been designed to accommodate these as well as might be hoped. If you have many (like 100+) such statements in a program, it is possible that it can eventually cause an automatic storage overflow error, possibly triggered when some other normal but unrelated exception has occurred. I speak from experience. When this happens in a production job, like an http server, it can be devastating, since the job is left in some sort of unstable state that can affect subsequent requests. It does not affect fixed length return values or varying length parameters. Peter -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Brad Stone Sent: Thursday, 20 May 2004 11:25 a.m. To: RPG programming on the AS400 / iSeries Subject: Re: Variable Length Field Question On Wed, 19 May 2004 17:18:13 -0500 (CDT) Scott Klement <klemscot@xxxxxxxxxxxx> wrote: > > Hi Brad, > > > Assume I have field varField defined as Varying in an > RPG > > program. > [SNIP] > > eval varField = '^^^^^^Data^^^^^' > > (Each ^ is a blank) > [SNIP] > > Should varField then equal: > > "^^^^^^Data" > > No. It should equal exactly what you assigned to it. > '^^^^^^Data^^^^^' > Ok, the reason I ask is I have a subprocedure that reads and IFS file. After the read it does this: return $subst(buffer:1:BytesRead) When I call it using a variable length field as the return variable, it's getting the leading blanks truncated from it. The return field is not defined as Varying in the subprocedure. just 32767 byte field (may switch it to varying in the future... just testing now). So if I return '^^^^^^^^^^^^^Data' I get back: 'Data' Very odd. _______________________________________________ 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 correspondence is for the named person's use only. It may contain confidential or legally privileged information, or both. No confidentiality or privilege is waived or lost by any mistransmission. If you receive this correspondence in error, please immediately delete it from your system and notify the sender. You must not disclose, copy or rely on any part of this correspondence if you are not the intended recipient. Any views expressed in this message are those of the individual sender, except where the sender expressly, and with authority, states them to be the views of Baycorp Advantage. If you need assistance, please contact Baycorp Advantage on either :- Australia 133124 or New Zealand +64 9 356 5800
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.