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 Future consideration
Workspace IBM i
Categories Languages - RPG
Created by Guest
Created on Dec 14, 2023
Merged idea

This idea has been merged into another idea. To comment or vote on this idea, please visit IBMI-I-3688 Add %OFFSET built-in function to retrieve the position of a Subfield within a Data Structure.

New BIF to return position of subfield within a data structure Merged

I'd like to see a BIF that returns the position of a subfield or nested DS in a data structure.

Perhaps something like

%pos(<subfield>:<datastructure>)


Example:

Consider a DS like

       dcl-ds parm qualified;
rtn char(5);
rtnMsg char(128);
Id char(21);

Driver char(16);
EvtDatTim char(26);

RecDatTim char(26);

ExternalId char(64);
RcdSts char(1);
RcdOrg char(1);
Type char(1);
Code char(1);
SeqX char(10);
Tractor char(16);
dcl-ds Location;
Latitude zoned(9:6);
Longitude zoned(9:6);
end-ds;
Odometer zoned(11:1);
end-ds;

The first three subfields are passed back to the caller, but the rest of the subfields are passed in. If I wanted to log that input part, I could code:

InputStart = %pos(Driver: parm);   // returns 155
LogInput = %subst(parm: InputStart);


Also in this example:

%pos(Longitude: parm.Location) 

would give the position of Longitude inside Location (returns 10), and

%pos(Location.Longitude: parm)

would give the position of Longitude within the full parm ds (returns 326).

Idea priority Medium
  • Guest
    Reply
    |
    Dec 15, 2023
    Your request is a duplicate of IBM Idea IBMI-I-3688. https://ibm-power-systems.ideas.ibm.com/ideas/IBMI-I-3688.

    That Idea is requesting a %OFFSET built-in function, but the response from IBM says that a %POS built-in function would likely be added at the same time.

    - IBM Power Systems Development