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 22, 2016

Provide %InList Built In Function

Provide a new BIF %InList() or %OrList() to check if a variable's value exit in list.


Use Case:

Dcl-S MyState Char(2) Inz('CA')

If %InList(MyVar : 'CA' : 'NV': 'AZ': 'NM': 'NY');
do something
EndIf;

Or

If %InList(MyVar : ',' : 'CA,NV,AZ,NM,NY'); // Comma is defined as a delimiter for list of values.
do something
EndIf;


Idea priority Medium
  • Guest
    Reply
    |
    Nov 12, 2020

    IBM believes that the request described has been solved and is available with PTFs for 7.3 and 7.4.

    The ILE RPG compiler is enhanced with new built-in function %LIST:

    PTFs for 7.3:
    - SI74612: TGTRLS(*CURRENT) compiler

    PTFs for 7.4:
    - SI74613: TGTRLS(*CURRENT) compiler
    - SI74614: TGTRLS(V7R3M0) compiler

    For more details, please see https://ibm.biz/rpgcafe_fall_2020_new_bifs_foreach_opcode

  • Guest
    Reply
    |
    Oct 22, 2020

    IBM agrees with the request and a solution appears to be desirable and feasible. IBM intends to provide a solution.

    The enhancement is a %LIST built-in function with a new IN operator.

    If MyVar IN %List( 'CA' : 'NV': 'AZ': 'NM': 'NY');

    See https://ibm.biz/rpgcafe_fall_2020_new_bifs_foreach_opcode for information.

  • Guest
    Reply
    |
    Jun 9, 2020

    I did this back on V3R7, COZTOOLS v1.0

    C IF InList(myValue : a : B : c : d); // as many as 32 values
    C ...
    C endif

    I like the %LOOKUP suggestion, however developers often do like to code stuff right in place, so I guess this is still a viable request.

  • Guest
    Reply
    |
    Apr 24, 2020

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

  • Guest
    Reply
    |
    Feb 17, 2020

    The COMMON Europe Advisory Council (CEAC) has reviewed this requirement and recommends that IBM view this as a MEDIUM priority requirement that should be addressed.

    If you have new developers this would also help RPG to be perceived as a modern language and kept being evolved.

    Background: The 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
    |
    Feb 27, 2018

    The CAAC has reviewed this requirement and recommends that IBM view this as a medium priority requirement that should be addressed. This would provide desirable and simple functionality similar to the IN predicate in SQL.

    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
    |
    Jan 12, 2018

    This would work with any data type, character, numeric, date etc. The values for the IN operator or the values in %LIST would not be required to have the exact same data type. They would just have to be comparable to each other, similar to the rules for the IF opcode.

  • Guest
    Reply
    |
    Aug 25, 2017

    Wold this be limited to char only or might we aspect that %list (and so forth IN) will allow for numeric data???

  • 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.

    If IBM implements this, it would most likely be in the form of a new IN operator plus a %LIST built-in function.

    if MyVar IN %List('CA' : 'NV': 'AZ': 'NM': 'NY');

  • Guest
    Reply
    |
    Jul 29, 2016

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

  • Guest
    Reply
    |
    Jul 12, 2016

    My own thoughts on this are similar to WorksOfBarry's:

    For the first case, the implementation would likely be a more general built-in function, %LIST(item1 : item2 ...) where the result of %LIST would be allowed anywhere an array is allowed except SORTA.

    For the second case, where a single string is provided with a delimiter, the implementation would likely be a more general built-in function %SPLIT(string : delimiter) where the delimiter defaults to blanks. The result of %SPLIT would be valid wherever an array is allowed except SORTA.

    Then the result of %LIST or %SPLIT could be used as the array operand in the %LOOKUP built-in function.

    However, to simplify the syntax, a new IN operator might be added to simplify checking for the existence of an item in an array, %LIST and %SPLIT.
    if myvar in myarray
    equivalent of: %LOOKUP(myvar : myarray) > 0

    if myvar in %LIST(item1 : item2 : item3)

    if myvar in %SPLIT(string : ',')

  • Guest
    Reply
    |
    Jul 12, 2016

    Sounds like something %Lookup and %Scan can do.

    %InList(MyVar : 'CA' : 'NV': 'AZ': 'NM': 'NY')
    %Lookup(MyVar:ArrayOfStates)

    %InList(MyVar : ',' : 'CA,NV,AZ,NM,NY')
    %Scan(MyVar:'CA,NV,AZ,NM,NY')

    // Comma is defined as a delimiter for list of values.
    I'd love something that could split a character variable.
    Array = %Split(',':'CA,NV,AZ,NM,NY')

  • Guest
    Reply
    |
    Jun 24, 2016

    If IBM implements this, variables would be allowed for any of the operands of the new built-in function.

  • Guest
    Reply
    |
    Jun 23, 2016

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

  • Guest
    Reply
    |
    Jun 23, 2016

    This might more be valuable if the list contents could be populated with either compile time data as well as run time data. The example provided shows a list of state abbreviations. This might be loaded as a named constant at compile time however it could also be loaded from a table during *INZSR at run time.

0 MERGED

Provide %In BIF

Merged
Please provide some sort of SQL "in" BIF in RPG to make it easier testing for multiple values. It would be nice if I could write; If %In(Gender: 'M': 'F') instead of If Gender = 'M' or Gender = 'F' This should work for any number of values, regard...
over 3 years ago in IBM i / Languages - RPG 3 Delivered
0 MERGED

For RPGLE enhance ability to list field values

Merged
Modify RPGLE language to allow for testing of multiple values in a single field by entering a values list. Coding such as INLIST to include a values list or NOT INLIST to exclude a values list when testing of a single field. This would very simila...
almost 7 years ago in IBM i / Languages - RPG 5 Delivered