Skip to Main Content
IBM Power Ideas Portal


This portal is to open public enhancement requests against IBM Power Systems products, including IBM i. To view all of your ideas submitted to IBM, create and manage groups of Ideas, or create an idea explicitly set to be either visible by all (public) or visible only to you and IBM (private), use the IBM Unified Ideas Portal (https://ideas.ibm.com).


Shape the future of IBM!

We invite you to shape the future of IBM, including product roadmaps, by submitting ideas that matter to you the most. Here's how it works:

Search existing ideas

Start by searching and reviewing ideas and requests to enhance a product or service. Take a look at ideas others have posted, and add a comment, vote, or subscribe to updates on them if they matter to you. If you can't find what you are looking for,

Post your ideas
  1. Post an idea.

  2. Get feedback from the IBM team and other customers to refine your idea.

  3. Follow the idea through the IBM Ideas process.


Specific links you will want to bookmark for future use

Welcome to the IBM Ideas Portal (https://www.ibm.com/ideas) - Use this site to find out additional information and details about the IBM Ideas process and statuses.

IBM Unified Ideas Portal (https://ideas.ibm.com) - Use this site to view all of your ideas, create new ideas for any IBM product, or search for ideas across all of IBM.

ideasibm@us.ibm.com - Use this email to suggest enhancements to the Ideas process or request help from IBM for submitting your Ideas.

Status Delivered
Workspace IBM i
Categories Languages - RPG
Created by Guest
Created on Mar 3, 2020

RPG datastructure array sort by more than one subfield

For RPG please provide extended sort capability for datastructure arrays. This means sorting of an array over more then one subfield.
E.g.: sorta name_of_array(*) (subfieldx: subfieldY: …) using the names of the subfileds
Or sorta name_of_array(*) (3: 1: ...) using the ordinal position of the subfields


Use Case:

- sorta name_of_array(*) (subfieldx: subfieldY: …) using the names of the subfileds
- sorta name_of_array(*) (3: 1: ...) using the ordinal position of the subfields


Idea priority Medium
  • Guest
    Reply
    |
    Sep 8, 2021

    IBM believes that the request described has been solved and is available with the enhancement for the SORTA operation code to specify the sort subfields using %FIELDS. This enhancement is available for 7.3 and 7.4 with PTFs.

    For 7.3, you need PTF 5770WDS SI77165.

    For 7.4, you need PTF 5770WDS SI77166.

    For 7.4 TGTRLS(V7R3M0), you need PTF 5770WDS SI77167.

    For more information, see https://www.ibm.com/support/pages/node/6481975.

  • Guest
    Reply
    |
    Jun 29, 2021

    The CAAC has reviewed this requirement and recommends that IBM view this as a medium priority requirement that should be addressed. This continues the process of making RPG more consistent with other languages.

    Background: The COMMON Americas Advisory Council (CAAC) members have a broad range of experience in working with small and medium-sized IBM i customers. CAAC has a key role in working with IBM i development to help assess the value and impact of individual RFEs on the broader IBM i community, and has therefore reviewed your RFE.

    For more information about CAAC, see www.common.org/caac

    Nancy Uthke-Schmucki - CAAC Program Manager

  • Guest
    Reply
    |
    Mar 4, 2021

    Thanks, Barbara - I figured there would be limitations - and next time I'll spell "contiguous" correctly - not sure what "con-chuh-gus" is!

    And QSORT can always accomplish the goal, albeit with some effort. Something more native could be useful.

  • Guest
    Reply
    |
    Mar 4, 2021

    Vern, you can do that, but be careful to only include subfields where the sort order is the same when the data is sorted by its hex value. Some types don't sort correctly by their hex value. For example, the length would get included in the sort for varying length fields, dates with any format except *ISO wouldn't sort correctly, packed and zoned numeric fields wouldn't sort correctly if there might be negative values.

    Much safer to call QSORT, or even to write your own sort loop.

  • Guest
    Reply
    |
    Mar 4, 2021

    I am going to ask about a situation that is not covering every case - can an subfield that overlays contiugous subfields you want to sort on, can it be used in SORTA?

  • Guest
    Reply
    |
    Apr 21, 2020

    The CEAC has reviewed this requirement and recommends that IBM view this as a MEDIUM priority requirement that should be addressed.

    Background: The COMMON Europe Advisory Council (CEAC) members have a broad range of experience in working with small and medium-sized IBM i customers. CEAC has a crucial role in working with IBM i development to help assess the value and impact of individual RFEs on the broader IBM i community and has therefore reviewed your RFE.

    To find out how CEAC help to shape the future of IBM i, see CEAC @ ibm.biz/BdYSYj and the article "The Five Hottest IBM i RFEs Of The Quarter" at ibm.biz/BdYSZT

    Therese Eaton – CEAC Program Manager, IBM

  • Guest
    Reply
    |
    Apr 16, 2020

    IBM will use this request as input to planning but no commitment is made or implied. This request will be updated in the future if IBM implements it. IBM will use votes and comments from others in the community to help prioritize this request.

  • Guest
    Reply
    |
    Mar 4, 2020

    Peder, I think it would be much easier for an RPG programmer to code the SORTA with the list of subfields than to write a separate compare procedure. But the separate compare procedure would be useful if you wanted to compare some subfields descending and some ascending, or you wanted to do other types of special comparisons. So I think both ideas are good.

  • Guest
    Reply
    |
    Mar 3, 2020

    I suggested the possibility to implement a compare procedure for %lookup and sorta here:

    http://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=115361

    It would solve the problem you mention in this RFE and would be much easier to code and implement IMHO.