Skip to Main Content
IBM Z Software


This portal is to open public enhancement requests against IBM Z Software products. 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 PL/I Compilers
Created by Guest
Created on Dec 23, 2020

INITACCROSS initialisation for arrays of structures

Several releases ago, the language introduced a "DIMACROSS" attribute, to quote the Language Reference:

"The DIMACROSS attribute specifies a DIMENSION attribute on a structure, but one which will be removed from the structure and propagated to its members."

In line with this it would be nice to also introduce a "INITACROSS" type on initialisation.

Idea priority Medium
  • Guest
    Reply
    |
    Jun 10, 2022
    delivered in the 6.1 release this May
  • Guest
    Reply
    |
    Jan 15, 2021

    This could be useful in various situations and could make some code not only more readable but also easier and safer to maintain. There are even some declares in the compiler itself that could be better with this. An additional question/suggestion:

    this would allow for declares such as

    1 x(3) dimacross static
    initacross( ('de','germany')
    ,('fr','france')
    ,('sp','spain')
    )
    ,2 y char(2)
    ,2 z char(40) var
    ;

    but the(3) is not really needed - the compiler can figure this out by counting the number of parenthesized lists in the INITACROSS attribute. So this raises a question:

    if a DIMENSION attribute has not been specified, but DIMACROSS has been should the compiler infer the DIMENSION attribute? so this would be allowed

    1 x dimacross static
    initacross( ('de','germany')
    ,('fr','france')
    ,('sp','spain')
    )
    ,2 y char(2)
    ,2 z char(40) var
    ;

    This would make adding a new entry very easy: just insert the values for that entry in INITACROSS and then the compiler will do the rest.

    Perhaps the latter version should be the only acceptable use of INITACROSS? then there would be no need to check the number of dimensions from INITACROSS what has been specified somewhere else - and then we could go further and remove even the need for DIMACROSS??

  • Guest
    Reply
    |
    Jan 12, 2021

    This could be useful in various situations and could make some code not only more readable but also easier and safer to maintain. There are even some declares in the compiler itself that could be better with this

  • Guest
    Reply
    |
    Jan 11, 2021

    Your understanding is correct, the "initaccross" should do what "dimacross" does for bounds, allowing, as in my example, to keep related values together instead of some screens down.

  • Guest
    Reply
    |
    Jan 7, 2021

    I think the intent of this feature would be for situations where you had a declare such as

    dcl
    1 info(2) static,
    2 iso char(2) init( 'AT', 'AF' )
    2 name char(30) var init( 'Austria', 'Afghanistan' );

    which requires that when a new country is added, that the 2 values would have to be inserted in the correct places but possibly far apart.

    However, making additions would be much easier if the declare was

    dcl
    1 info(2) static
    INITACROSS( ( 'AT', 'Austria' )
    , ( 'AF', 'Afghanistan' )
    ),
    2 iso char(2),
    2 name char(30) var;

    Robert, please correct me if I have misunderstood the intent of the RFE.

  • Guest
    Reply
    |
    Jan 6, 2021

    So, it's too hard to understand that the example is just a plastic short-cut for "INITACROSS (('AT', 'Austria'),('AF', 'Afghanistan'), ..., ('ZW',Zimbadwe'))" ? Sigh...

  • Guest
    Reply
    |
    Dec 28, 2020

    In your use case the "INITACROSS ((ISO, COUNTRY), (ISO, COUNTRY),...)" is a constant value not the real value. Therefore I fail to see the benefit of having the array init with the a value vs init the array with blank . All the real values of iso and corresponding countries have to rely on a source which the values(ISO,COUNTRY) have to be read from into the array.