× 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 have to disagree with this Scott.  There is another way - in fact I was
coding this very thing last night!  You do need to use a pointer in the
called procedure to match the incoming parm (which has to be defined as a
single instance of the DS) with the actual mapping MODS in the called
procedure but it works fine.

That's true. Though, you have to make sure you don't use CONST or VALUE in that case. In fact, you could use LIKE() to define the parameter to help make it self-documenting (or, on V5R1, LIKEDS)

AS long as you set the occurrence to 1 in the caller it all works fine and while not as completely intuitive as being able to just pass a parm declared as a MODS, the ability to use LIKEDS has significantly improved things.

V5R1 is the only release where I'd use LIKEDS with a MODS -- in V5R2 or later, I'd use an array of data structures instead. I never had the opportunity to work on a V5R1 system, since we skipped from V4R5 to V5R2, here.

In any case, you're absolutely correct that you can eliminate the pointer as a parameter to the subprocedure. (but you still have to use the pointer internally.)

It's a kludge, though. The caller shouldn't have to set it's occurrence to something else and set it back. The subprocedure shouldn't have to redefine the MODS. Data structure arrays are the right way to do it.



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.