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 Jun 15, 2018

Implement new %POS BIF to facilitate soft coding of DS overlays

Currently if you want to redefine a portion of a Data Structure (usually as an array) you have limited choices.

One approach is to manually key the names of all required fields into a DS and then overlay those fields with an array. This is tedious if a large number of fields (for example one for each day of the month) are required.

Alternatives are to use an externally described DS based on the file in question and using the POS keyword to position the start of the redefinition. Alternatively one can use the %Addr of the field at which redefinition will begin and and use that as the basing pointer for a separate DS or array.


Proposed resolution: Provide a new BIF (%POS) which takes a field name as the parameter and returns the offset of the field within its defining structure. The BIF could be used as a parameter to POS() to avoid hard coding the start position.

Alternatively the current POS keyword could be modified to accept a field name as the parameter. While this would meet the immediate requirement it provides less flexibility that the BIF approach since this could also be used for other purposes.


Use Case:

Given a file MTHSALES where field Q1 is the first of four fields constituting quarterly sales figures. Adding the array definition to an externally described DS requires counting to determine the start position of Q1:

Dcl-DS salesInfo ExtName('MTHSALES');
salesForQtr Pos(65) Like(Q1) Dim(4);
End-DS;

Using the proposed BIF would remove the hard coding requirment:

Dcl-DS salesInfo ExtName('MTHSALES');
salesForQtr Pos(%Pos(Q1)) Like(Q1) Dim(4);
End-DS;

Changes to the underlying record format would not impact this method.


Idea priority Medium
  • Guest
    Reply
    |
    Apr 23, 2019

    The ILE RPG compiler is enhanced with the new SAMEPOS keyword with PTF SI69572 for 7.3.

    See http://ibm.biz/rpg_samepos_keyword for more information.

  • Guest
    Reply
    |
    Jan 3, 2019

    .IBM agrees with the request and a solution appears to be desirable and feasible. IBM intends to provide a solution. However, IBM's plans may change and no commitment is made that a solution will be provided.

    If this feature is delivered, it will be in the form of a new D-spec keyword rather than a new %POS built-in function.

  • Guest
    Reply
    |
    Jul 24, 2018

    The CAAC has reviewed this requirement and recommends that IBM view this as a medium priority requirement that should be addressed. As a workaround one can use the POS keyword, but it is cumbersome. This support is analogous to C++, so it would make sense to provide this.

    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

    For more details about CAAC's role with RFEs, see http://www.ibmsystemsmag.com/Blogs/i-Can/May-2017/COMMON-Americas-Advisory-Council-%28CAAC%29-and-RFEs/

    Nancy Uthke-Schmucki - CAAC Program Manager

  • Guest
    Reply
    |
    Jun 19, 2018

    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.

    Following Niels' suggestion, if implemented, the new built-in function would be called %SUBFPOS.

  • Guest
    Reply
    |
    Jun 17, 2018

    Brilliant idea. But could we call it %DSPOS or something similar since %POS is would be more like in a string operation. Just to avoid the confusion.