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 Not under consideration
Workspace IBM i
Categories Db2 for i
Created by Guest
Created on Mar 24, 2019

Ability to sort WRKQRY/RUNQRY in arrival sequence

With the changes being made to query and its move from the CQE to SQE, this has exposed an issue where it offers no way to sort records in arrival sequence. The record order cannot be guaranteed unless it is specified as a sort field but query has no sort field for arrival sequence.
I believe that in order to maintain backward compatibility, if the query optimiser decides it will read the file in arrival sequence and no sort order is specified, the records should be retrieved in arrival sequence order or some means of specifying arrival sequence as a sort option needs to be included.


Use Case:

A simple case is issuing RUNQRY to display a file: RUNQRY QRYFILE((lib/file)). Traditionally, this has presented the records in arrival sequence but with recent OS changes this may no longer be the case and it's not possible to sort it by RRN as there is no option to do this.


Idea priority Medium
  • Guest
    Reply
    |
    May 14, 2020

    Db2 for i has no plans to extend WRKQRY/RUNQRY in the manner described in this RFE.
    As was noted already, you can order by RRN via any SQL interface.
    Setting SQE_NATIVE_ACCESS to NO is an extreme measure and should only be used when recommended by IBM Service.
    This QAQQINI has been deprecated in IBM i 7.4, so I strongly encourage that clients avoid using this control unless recommended by IBM Service as a temporary measure.
    http://ibm.biz/IBMi_74_MTU
    Closing as declined.

  • Guest
    Reply
    |
    Mar 25, 2019

    I found the following URL helpful. If you're using an ACS file transfer (.dtfx) for the query results, you can put RRN(filename) in the Order By section of the Data Options.
    https://www-01.ibm.com/support/docview.wss?uid=nas8N1016738

  • Guest
    Reply
    |
    Mar 25, 2019

    Sorry Steve, I did not read your comment. I seems we have given both the same work around.

  • Guest
    Reply
    |
    Mar 25, 2019

    Hello John,

    We had a similar issue a while ago where a query failed when moving from CQE to SQE. As it took IBM time to get a PTF ready, we preferred to run this query with CQE using the following workaround:
    1. create a empty QAQQINI in a user library,
    2. add a record with the following values for QQPARM the value "SQE_NATIVE_ ACCESS" and for QQVAL the value "NO"
    3. before running the query use the command: CHGQRYA QRYOPRLIB()
    4. Run your query as before
    5. Reset the job to the previous QAQQINI file, with the command CHGQRYA QRYOPTLIB(QUSRSYS)

    The above worked for us, I hope it also does for you.

    Greetings Rudi

  • Guest
    Reply
    |
    Mar 25, 2019

    The rule of thumb is however that without an explicit order clause there's no order.

    What you consider as your arrival sequence is something that is not something that you can take for granted.

  • Guest
    Reply
    |
    Mar 25, 2019

    Hi
    I think IBM has given you the option to change the behaviour back to it's Pre-72 CQE ways.

    You simply need to make a change to QAQQINI control called SQE_NATIVE_ACCESS with a default value of *YES

    More Details below:

    https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_72/rzaq9/rzaq9osDBSQEvsCQE.htm

    Hope this helps.
    Steve