On 2022-04-29 11:05 a.m., Charles Wilt wrote:
There is no options(*varchar)

I assume from the title you mean options(*varsize)

options(*varsize) and varchar()/varying are two very different things

...and Jon beat me to the details... :)


Further to what Jon and Charles said, you have to be very careful with OPTIONS(*VARSIZE) to make sure you don't access more storage than the caller passed, especially if you use it without CONST. (But even with CONST you have to be careful ...)

Basically, you need some way of knowing how big the actual parameter is, either by passing the length as a separate parameter, or coding the OPDESC keyword for the prototype and calling CEEDOD to get the length.

Here's the doc for the OPTIONS keyword. With a warning in the *VARSIZE section about accessing too much storage. https://www.ibm.com/docs/en/ssw_ibm_i_74/rzasddoptns.htm


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