Sorting Subfile Data

2920 pts.
Tags:
AS/400 subfile
SQLRPGLE
Subfile Display
Hello, I have a subfile having fields Name, Age, Address. These data are loaded from different Physical files using different conditions into Subfile by embedded sqlrpgle. Now I want to sort the subfile data by Age. What are the possible ways for this? I don’t want to load these data into a physical file and sort and display.
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 6  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.
  • Splat
    Look into keyed data queues.
    12,935 pointsBadges:
    report
  • GregManzo
    If you data is all fetched by a single SQL & your pgm is just loading it into the subfile, you can add an 'order by' clause to the SQL statement.
    Otherwise you can load it into an array in memory & sort that. Consider looking into dynamic arrays too.
    2,980 pointsBadges:
    report
  • Sureyz
    I have done as below which is working

    But unable to sort using, SORT(A) SFDS(*).ds_Days




    SFDS             DS                  Qualified Dim(9999)
     Ds_Days                        4p 0                    
     Ds_Note                       50a                      
    2,920 pointsBadges:
    report
  • ToddN2000
    What does your embedded SQL look like? I think you might try and go the way of using the "order by" as well. Without seeing the code we can only make suggestions on ways we would do it. If there are limitations on how you are building the table that we are unaware of let us know. There may be a few other solutions. 

    136,970 pointsBadges:
    report
  • TheRealRaven
    @Sureyz : What is meant by "unable to sort"? Is there an error? What happens?
    37,225 pointsBadges:
    report
  • Sureyz
    An error occurred. An Operation Extender is not allowed with the Operation Code specified. 

    SortA(A) %SubArr(SFDS(*).Ds_Days:1:j) 
    2,920 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.

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

Following

Share this item with your network: