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).
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:
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 an idea.
Get feedback from the IBM team and other customers to refine your idea.
Follow the idea through the IBM Ideas process.
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.
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
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.
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.
This request is still a candidate to be an enhancement for the RPG compiler.
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
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
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.
Wold this be limited to char only or might we aspect that %list (and so forth IN) will allow for numeric data???
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');
.IBM has received the requirement and is evaluating it. IBM will provide a response after evaluation is complete.
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 : ',')
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')
If IBM implements this, variables would be allowed for any of the operands of the new built-in function.
Creating a new RFE based on Community RFE #90446 in product IBM i.
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.