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 Aug 16, 2016

Add New BIF's %right() and %left()

While %left(str: int) can be done with a %subst(str: 1: int), %right(str: int) is not so straight forward.

%right(str: int) must be written as %subst(str: %len(%trimr(str)) - (int - 1))

This is far less readable.

Please add convenience BIF's %left(str: int), and %right(str: int).


Use Case:

Expression simplification, readability, and maintainability.


Idea priority Medium
  • Guest
    Reply
    |
    Nov 17, 2023
    IBM believes that the solution for the Idea described is available for 7.4 and 7.5 with the following PTFs for new built-in functions %LEFT and %RIGHT.

    7.4:
    ILE RPG compiler: 5770WDS SI84886

    7.5:
    ILE RPG compiler: 5770WDS SI85009
    ILE RPG compiler, TGTRLS(V7R4M0): 5770WDS SI85043

    For more information, see https://www.ibm.com/support/pages/node/7047134.

    - IBM Power Systems Development
  • Guest
    Reply
    |
    Jan 22, 2021

    By the way if you are going to implement an %RIGHT() function then please make it possible to use it as a result of an assignment. Just like %SUBST()

  • Guest
    Reply
    |
    Jan 22, 2021

    Please avoid abbreviations like %RSUBST() when RIGHT() and LEFT() are well known in SQL and many other languages. It will be much easier to remember and use %RIGHT() and %LEFT().

    For example we have the %EDITC() function in RPG but in DDS it is called EDTCDE.
    I don't know how many times I have written %EDTCDE() instead of %EDITC()
    and I don't understand why the naming hasn't been standardised.

  • Guest
    Reply
    |
    May 18, 2020

    The CEAC has reviewed this requirement and recommends that IBM view this as a MEDIUM priority requirement that should be addressed.

    Background: The COMMON Europe Advisory Council (CEAC) members have a broad range of experience in working with small and medium-sized IBM i customers. CEAC has a crucial 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.

    To find out how CEAC help to shape the future of IBM i, see CEAC @ ibm.biz/BdYSYj and the article "The Five Hottest IBM i RFEs Of The Quarter" at ibm.biz/BdYSZT

    Therese Eaton – CEAC Program Manager, IBM

  • Guest
    Reply
    |
    Apr 27, 2020

    This request is still a candidate to be an enhancement for the RPG compiler.

  • Guest
    Reply
    |
    May 21, 2019

    Consider amending %subst to accept a negative start position meaning start from the right and count back. No need for any new BIFs.

  • Guest
    Reply
    |
    Aug 1, 2017

    The CAAC has reviewed this requirement and recommends that IBM view this as a medium priority requirement that should be addressed. This requirement will make IBM i more mainstream and similar to how other products do 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/

    Dawn May - CAAC Program Manager

  • Guest
    Reply
    |
    Mar 30, 2017

    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.

  • Guest
    Reply
    |
    Nov 3, 2016

    The suggestion to also add %Center to center text in a field is different from the proposed %Left and %Right which substring from either the left or the right. Adding a centering function would be a separate RFE.

    It probably wouldn't be named %Center, since %Left, %Center, %Right would seem to be related, and that could cause confusion over what %Left and %Right do.

    A possible alternative to the name %Center is a set of %Pad built-in functions, %PadLeft, %PadRight, and %Pad that would add blanks on the left, right, or both to achieve the required length. But again, that would require a separate RFE.

  • Guest
    Reply
    |
    Nov 3, 2016

    and %Center that would center text in a field. As with the others, this can be done in a program, but is often unique as anytime it is needed the fields are different sizes.

  • Guest
    Reply
    |
    Oct 28, 2016

    IBM has received the requirement and is evaluating it. IBM will provide a response after evaluation is complete.

  • Guest
    Reply
    |
    Sep 21, 2016

    A %RIGHT built-in function wouldn't have an implicit %TRIMR. It would just take the last N characters.

    A substring-right built-in function would probably have to be named %RSUBST, to avoid confusion with abbreviations for "substring" in other languages, and especially since the debugger has a built-in function %SUBSTR which means the same as %SUBST.

  • Guest
    Reply
    |
    Sep 21, 2016

    Since we already have %Subst, why not a %SubstR rather than duplicate the function to create a %Left & %Right?

  • Guest
    Reply
    |
    Aug 17, 2016

    Creating a new RFE based on Community RFE #93115 in product IBM i.