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



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.



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.