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



> Neither the prototype, not the callp is correct.  The prototype is
> wrong because the smKeyPos, smKeyLen, smKeyType, smKeyDir parameters
> are supposed to be arrays, and you don't have them defined as arrays.

But they are correct if only one of each is fed, right?  But your
modification would be the prudent change, thanks.

> Also, the smArrPtr is not supposed to be a pointer, but rather the
> start of your MODS passed by reference.  It should be defined to be
> the size of your MODS, but since that can vary, I just prototype it
> as a very large string, and use options(*varsize) to allow the size
> to vary.

And that's the key point I was looking for.

> Instead, it should look like this:
> 
>       D SortMods        pr                  Extpgm('SORTMODS')
>       D  smArrPtr                  32767A   options(*varsize)
>       D  smCount                       5  0 Const
>       D  smElemLen                     5  0 Const
>       D  smNumKeys                     3  0 Const
>       D  smKeyPos                      5  0 Const
>       D                                     dim(32767)
>       options(*varsize) D  smKeyLen                      5  0 Const
>       D                                     dim(32767)
>       options(*varsize) D  smKeyType                     1    Const
>       D                                     dim(32767)
>       options(*varsize) D  smKeyDir                      1    Const
>       D                                     dim(32767)
>       options(*varsize) D  smExitCd                      1
> 
> The reason that I used dim(32767) is to allow as many array elements
> as you like to be passed to the program.  The options(*varsize)
> parameter allows you to pass fewer elements than 32767, since you
> won't usually need that many keys 

> Instead, just pass arrDtOrd itself:
> 
>       SortMods (arrDtOrd :  . . .

Yup, makes sense now.

Thanks.

Bill

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.