+ Reply to Thread
Results 1 to 3 of 3

Thread: Dynamic sort of data in ILE????

  1. #1
    Guest.Visitor Guest

    Default Dynamic sort of data in ILE????

    Erik, I don't have a real clear picture of what it is you need, but I think the QLGSORT API is what you should check out. Bill > Is it possible to dynamically sort data in a physical file within an ILE program?

  2. #2

    Default Dynamic sort of data in ILE????

    Is it possible to dynamically sort data in a physical file within an ILE program? I have a program that displays data in a subfile. I need to allow the users to select different 'Sorts' of the data for display. The sorts will be multi-field sorts and instead of excluding data the data will be reorganized with the users selection at the top and a default sort after that. The user's will be able to 'Sort' data based on 3 fields with 108 or more possible combinations. The problem is that I can't find a way to get a logical file to do what I need to do. The user can select one of 6 subjects ,fiction or nonfiction, and one of three types of books. It the user picks a subject it will appear at the top of the subfile with the other subjects below it in a default sort order. Fiction or Non-fiction displays both fiction and nonfiction with the selected category at the top. The book types will work in a similar manner. There are six possible subjects defined by an X in one position of an 8 position character field.(Positions 5 and 7 are not used anymore) Fiction/Nonfiction and book type come from a 4 character field. The first character is an F or an N(fiction/nonfiction), the second character is the book type(A, P, or R). The third character is grade level which will always be sorted ascending and the fourth character is not used for the sort. How do I get the sort to work on the subjects if the user picks a subject with an X in postion eight of the subject field instead of a subject with an X in position one? Also, how do I get the secondary sort/s to work? Since this is not Include/Exclude I'm not sure how to proceed. This is a hierarchical look at the possible sorts starting with subject: Sub1 Sub2 Sub3 Sub4 Sub5 Sub6 Fiction Nonfiction Type1 Type2 Type3 Default Grade Level Sort(Ascending) 4 levels Any help would be appreciated. Thank you, Erik J. Osberg

  3. #3

    Default Dynamic sort of data in ILE????

    Thanks for the help, I ended up using a new TAATOOL, SORTDBF to accomplish the sorts. I built the command in CL, copied it into my ILE program and made the necessary changes. SORTDBF selects the records and sorts them then creates a file in QTEMP. I then overrode the file in the program to the QTEMP file created by SORTDBF. It works wonderfully. Erik

+ Reply to Thread

Similar Threads

  1. Sort Array in RPG using data structure
    By sanjivtannu@yahoo.com in forum RPG
    Replies: 0
    Last Post: 05-13-2005, 04:57 AM
  2. Replies: 1
    Last Post: 11-10-2003, 05:01 AM
  3. Dynamic Data
    By Guest.Visitor in forum General
    Replies: 1
    Last Post: 05-08-2002, 01:48 PM
  4. How do I enter data into a table for a sort?
    By Guest.Visitor in forum Programming
    Replies: 4
    Last Post: 06-22-2001, 07:01 AM
  5. Using a data queue to sort a subfile
    By Guest.Visitor in forum Programming
    Replies: 7
    Last Post: 08-09-2000, 01:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts