AS/400 SORTA command

1215 pts.
Tags:
AS/400
AS400 RPGLE
How to sort array in Descending order using SORTA Command?

Software/Hardware used:
AS400

Answer Wiki

Thanks. We'll let you know when a new response is added.

It can depend on what version you’re compiling to. In i V6.1 and earlier, you would define the sort order on the D-spec along with the DIM() attribute:<pre>
d pk s 10i 0 dim( 20 ) descend</pre>
In V7.1, the SORTA op-code can have a (A) or (D) extender.

Tom

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • rajeshece
    I wanted to decide the array order in run time... Is ther any way to do it in V5R4?
    1,215 pointsBadges:
    report
  • TomLiotta
    I wanted to decide the array order in run time… Then don't use SORTA. Use qsort() or the Sort (QLGSORT) API or your own sorting procedure. SORTA is a compiled sort instruction. It is static, not dynamic. Of course, you might OVERLAY() an ASCEND array and a DESCEND array over the same memory area. Then you might use SORTA over one array or the other. You would retrieve the elements from the base array that the other two redefined, I suppose. I haven't tried. Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following