IBM Support

Fall 2026: Initialize an array with a list of values

News


Abstract

Information about the PTFs for the ILE RPG enhancement that provides the ability to initialize an array with a list of values

Content

You are in: RPG Cafe Fall 2026: Initialize an array with a list of values

Short URL: https://ibm.biz/rpgcafe_fall_2026_inz_list

 

Fall 2026: Initialize an array with a list of values

 

Details

  • Initialize an array with INZ(*LIST:value1:value2...)
  • Initialize an array with INZ(enumeration)
  • Set the dimension with DIM(*INZ)
  • If there are more elements in the array than there are initialization values, the remaining elements are initialized with the default value for the array.
  • Varying-dimension arrays: If you use INZ(*LIST) or INZ(enum) with a varying-dimension array (DIM(*AUTO) or DIM(*VAR)), the array is initialized with the number of initialization values in the list or the enum. In that case, the initialization value for new array elements is the default value for the array. The values in the INZ keyword are only used for the initial initialization of the array.

Initialize an array with INZ(*LIST:values...)

        dcl-s days varchar(10) dim(7)
                   inz(*LIST : 'Monday'
                             : 'Tuesday'
                             : 'Wednesday'
                             : 'Thursday'
                             : 'Friday'
                             : 'Saturday'
                             : 'Sunday');

Initialize an array with INZ(enumeration)

        dcl-enum colors;
                   red 'red';
                   blue 'blue';
                   yellow 'yellow';
        end-enum colors;
        dcl-s color_choices varchar(10) dim(5) inz(basiccolors);
   

Set the dimension with DIM(*INZ)

If you initialize an array with a list of values (either *LIST or an enumeration name, you can use DIM(*INZ) to set the dimension of the array to the number of initialization values.

        dcl-s short_days char(3) dim(*inz)
               inz(*LIST : 'MON'  : 'TUE' : 'WED' : 'THU' : 'FRI' : 'SAT' : 'SUN');
   

PTFs for 7.5 and 7.6

7.5:

  • ILE RPG compiler: 5770WDS (PTF number to be updated later)

7.6:

  • ILE RPG compiler: 5770WDS (PTF number to be updated later)
  • ILE RPG compiler, TGTRLS(V7R5M0): 5770WDS (PTF number to be updated later)
 

RDi support

A later update for RDi will support this enhancement.

 

Documentation

The 7.5 and 7.6 ILE RPG Reference and ILE RPG Programmer's Guide are updated with full information about this enhancement. Start at the "What's new since 7.5", or "What's new since 7.6" section in the Reference.

[{"Type":"MASTER","Line of Business":{"code":"LOB73","label":"Power TPS"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SS69QP","label":"Rational Development Studio for i"},"ARM Category":[],"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"and future releases;7.5.0;7.6.0"}]

Document Information

Modified date:
27 October 2026

UID

ibm17289833