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 (

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 ( - Use this site to find out additional information and details about the IBM Ideas process and statuses.

IBM Unified Ideas Portal ( - Use this site to view all of your ideas, create new ideas for any IBM product, or search for ideas across all of IBM. - 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 Languages - RPG
Created by Guest
Created on Mar 16, 2023

RPG dynamic array enhancement

Enhance dynamic arrays dim(*auto/*var: maximum_elements) by allowing the "maximum_elements"-parameter to be a variable or constant.
This would allow in embedded sql fetch command to use always the right amount of lines by using the relative variable/constant as defined in the dim() advice.

Idea priority Medium
  • Guest
    May 10, 2023

    In IT Jungle there were recently an example to do something that looks
    like what you are trying to do. Not exactly the same, but close.

  • Guest
    Apr 10, 2023
    IBM does not intend to provide a solution to this Idea at this time, so it is being closed.

    Named constants are already allowed for the DIM keyword.

    It is not possible for the number of elements in the DIM keyword to be a variable.

    However, for the SQL FETCH command, you can specify the number of rows to retrieve using te FOR clause in the FETCH statement.

    If you define the array with DIM(*AUTO), the new dimension of the array will automatically be set to the number of rows actually fetched.

    dcl-ds myDs extname('MYFILE') qualified dim(*auto : 1000000) end-ds;
    dcl-s numRows int(10);

    exec sql fetch myCursor for :numRows rows into :myDs;

    If you define the array with DIM(*VAR), you can set the dimension before the FETCH statement by assigning to %ELEM.

    dcl-ds myDs extname('MYFILE') qualified dim(*var : 1000000);
    dcl-s numRows int(10);

    %elem(myDs) = numRows;
    exec sql fetch myCursor for :numRows rows into :myDs;

    - IBM Power Systems Development