×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Thank you Mel.  I'll try that tonight.

Just out of curiosity, could another solution be to change the size of the
varying field to a much lower number, say 100?  I'm not suggesting
changing CGIDEV2 just trying to understand what's going on.

508 x 100 = 50800

I actually have many more than 508 fields (coming from the browser) with
none of them greater then 40 in size.

Steve



> I was able to reproduce this problem on a V5R2 system.
>
> It appears that the mainline is calling subprocedure ZhbGetVar 508 times
> and  this is causing the compilation to fail with MCH3216.  This could
> be either a  system limitation (possibly a maximum of 16 MB for values
> returned by  subprocedures) or a bug (that is, the limitation should not
> exist).
>
> ZhbGetVar returns a 32767 varying field, which is 32769 bytes including
> its byte  length.  32769 times 508 comes very close to 16 MB.
>
> You may want to contact IBM service about this problem to see if it can
> be fixed  or whether it is, in fact, a limitation.
>
> In the meantime, you can get around the problem by writing your own
> subprocedure  that calls ZhbGetVar and returns the answer in one of its
> own parameters instead  of as a return value.  Instead of calling
> ZhgGetVar, you will call your  subprocedure.  Then, you will assign that
> value obtained by your subprocedure to  the target variable.
>
> Below is sample code (not a complete program; just relevant pieces).
> You would  need this only in programs that make hundreds of calls to
> ZhbGetVar and/or other  subprocedures that return a value with a long
> length.
>
> A variable for the value:
> D v32K            s          32767    varying
>
> The subprocedure's prototype
> D MyGetVar        pr
> D  varname                      50          const varying
> options(*varsize) D  varvalue                  32767          varying
> D  occurrence                   10i 0       const options(*nopass)
>
> The subprocedure's implementation
> P MyGetVar        b
> D MyGetVar        pi
> D  varname                      50          const varying
> options(*varsize) D  varvalue                  32767          varying
> D  occurrence                   10i 0       const options(*nopass)
>
> C                   if        %parms < 3
> C                   eval      varvalue = ZhbGetVar(varname:1)
> C                   else
> C                   eval      varvalue = ZhbGetVar(varname:occurrence) C
>                   endif
> P MyGetVar        e
>
> Sample use:
> C                   callp     mygetvar('custname':v32k)
> C                   eval      custname = v32k
>
> Mel Rothman, CGIDEV2 Author
> Mel Rothman, Inc.
>
>
> _______________________________________________
> 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 ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 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.