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



 >> After reading your reply , would you please give me a example of using
LIKEDS as I may be able to improve on what I have done.

Gladly Paul, but I don't regard it as an improvement.

MODS are a legacy concept and for the most part better off ignored in my
opinion.  I was only using one because I was writing a sample program that
will later be converted to be an SQL stored procedure.  Since DS Arrays are
not handled as return values by SQL until V5R3 (and I am running on a V5R2
system) I had to use a MODS when I would have preferred a DS Array.  Clear
as mud right!

Anyway - for those who want it ....

This is the code in the caller:

     D ReturnDS        PR                  ExtPgm('RETURNDS')
     D  CatCode                       2A
     D  RowCount                      5S 0
     D  OutDS                              LikeDS(ReturnDta)

     D ReturnDta       DS                  Occurs(99)
     D  ProductCode                   7A
     D  TotalCost                    12S 2
     D  TotalValue                   12S 2
     D  TotalMargin                  12S 2

      /FREE

       %Occur(ReturnDta) = 1;           // Ensure first element's address is
passed

       ReturnDS( CATCD : ROWS: ReturnDta);

And this is the bit in the called program:

     D ReturnDta       DS                  Based(pOutDS) Occurs(99)
     D  ProductCode                        Like(ProdCd)
     D  TotalCost                    12S 2
     D  TotalValue                   12S 2
     D  TotalMargin                  12S 2

      /FREE

       pOutDS = %Addr(OutDS);           // Map ReturnDta to the caller's
MODS

Hope this helps.

Jon Paris
Partner400

www.Partner400.com
www.RPGWorld.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.