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



Turns out that %LEN(*MAX) just gives me the information provided by the
prototype, which is of minimal use when OPTIONS(*VARSIZE) is also coded.
Seems to me that OPTIONS(*VARSIZE) when combined with OPDESC should key the
compiler to use the operational descriptor for things like %SIZE,
%LEN(*MAX), and %ELEM. It would make life a lot easier.

On Wed, Dec 19, 2018 at 2:11 PM Mark Murphy <jmarkmurphy@xxxxxxxxx> wrote:

The documentation is somewhat vague on Operational Descriptors. But I read
this:


Descriptors are normally accessed directly by a called procedure according
to the semantics of the HLL in which the procedure is written. Once a
procedure is programmed to expect operational descriptors, no further
handling is usually required by the programmer. However, sometimes a called
procedure needs to determine whether the descriptors that it requires are
present before accessing them. For this purpose the following bindable APIs
are provided:

- Retrieve Operational Descriptor Information (CEEDOD) bindable API
- Get String Information (CEEGSI) bindable API



in the Knowledge Center, here:
https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_73/ilec/apiopd.htm

That seems to me to be saying that the only thing I should need to do with
these API's is to determine if the operational descriptor is present or
not, but that the HLL (in this case RPGLE) should process the operational
descriptor.

So I have a procedure defined with OPDESC, and a Varchar defined with
OPTIONS(*VARSIZE). The Knowledge Center tells me this:


When OPTIONS(*VARSIZE) is specified, the passed parameter may be shorter
or longer in length than is defined in the prototype. It is then up to the
called program or subprocedure to ensure that it accesses only as much data
as was passed. To communicate the amount of data passed, you can either
pass an extra parameter containing the length, or use operational
descriptors for the subprocedure. For variable-length fields, you can use
the %LEN built-in function to determine the current length of the passed
parameter.


Does that mean that all I have to do is use %LEN(*MAX) and it will
interrogate the opdesc to determine the maximum length of the VARCHAR that
was passed? or will %LEN(*MAX) just tell me what I defined as the maximum
length in the procedure interface?


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.