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
Created by Guest
Created on Nov 21, 2022

RPG Refactor Redundant Code

It would be awesome to highlight a piece of code, find all instances of the highlighted pattern, and refactor all instances to a subroutine or a procedure.

For example, the code below. I found three instances of this code in the same program. This is redundant code. Right now, I have to manually find each instance of the code pattern and replace with subr or procedure. Having this ability to refactor would be a great addition to RDI.

xkco = zhco; xkpon = zhpon;
xkpoln = zhpoln;
xkpn = zhpn;
xkvend = zhvend;
xkfack = zoflup;
xkrno = zhno;
xklack = dateparts_to_yyyymmdd(doyy1:domm1:dodd1);
write xckhst;

Idea priority High
  • Guest
    Reply
    |
    Jan 31, 2023

    Along the theme of refactoring redundant code... I would l also like to suggest a way to refactor code based on patterns. I believe this could be done with regex. for example below. In the code I'm working with, this pattern is repeated at least a hundred different times. The message id and message file are different, but the rest of the code repeats. Right now, I am going thru each instance and wrapping the logic in a sub proc. it will take several hours to manually make the change. it would be fantastic if RDI had this capability.


    I tried do this by using the find/replace, but RDI will not allow me to do a multi line replace based on regular expressions.

    msgid = some_msg_id
    msgf = some_msg_file
    update a file with error message
    execute a subroutine to process error

  • Guest
    Reply
    |
    Jan 31, 2023

    @Marina, yes move redundant code into subproc. now the logic in once place.

  • Guest
    Reply
    |
    Dec 8, 2022
    Although the theme of this request is consistent with our business strategy, it is not committed to the release that is currently under development.

    IBM Power Systems Development - RDi team
  • Guest
    Reply
    |
    Nov 29, 2022

    You would not want to redundent code with redundent subprocedures or subroutines. Are you looking for what other IDE's do where you refactor a block of code and all of the places that use it now call that procedure or routine?

    Marina Schwenk