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.
7.4:
ILE RPG compiler: 5770WDS SI84886
7.5:
ILE RPG compiler: 5770WDS SI85009
ILE RPG compiler, TGTRLS(V7R4M0): 5770WDS SI85043
An enumeration can be qualified:
DCL-ENUM sizes QUALIFIED;
small 1;
medium 2;
large 3;
END-ENUM;
DCL-S size INT(10);
size = sizes.medium; // Use the qualified enum item
An enumeration can be unqualified:
DCL-ENUM truefalse;
true '1';
false '0';
END-ENUM;
DCL-S isValid ind;
isValid = true; // Use the unqualified enum item
You can also use enumerations as arrays. For more information, see https://www.ibm.com/support/pages/node/7047175.
- IBM Power Systems Development
Please combine that with the ability to use those enums as conditions in COBOL Level 88 manner!
The CAAC has reviewed this requirement and recommends that IBM view this as a medium priority requirement that should be addressed. This would help RPG become more "normal" -- this is a useful extension to RPG that is found in other languages.
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
Nancy Uthke-Schmucki - CAAC Program Manager
IBM has modified some of the information in this request. Please contact us if you have any questions.
Specifically, the headline has been updated, per earlier Comments in this RFE.
Previous Headline: Allow CONST keyword for data structures
New Headline: Add an enumeration type to RPG so that named constants can be qualified
Hello Stuart. I believe this RFE would attract more votes if the title was about "enum" rather than about a CONST keyword for data structures.
Do we have your permission to change the title to the following:
"Add an enumeration type to RPG so that named constants can be qualified"
Or, feel free to suggest a different new title in your response :-)
- Barbara Morris
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 this request is implemented, it would be in the form of an "enumeration" definition, as indicated in the comments for this RFE.
Jon, it is already possible to use LIKE with a template data structure subfield.
dcl-ds ds_t template qualified;
subf char(10);
end-ds;
dcl-s x like(ds_t.subf);
Yes, a genuine enum would be even better. Maybe I should have been greedier in the first place :)
Would a real enumeration type fulfill this requirement in a more direct way? If not, please give an example of how you would use LIKEDS with a CONST data structure.
Here is a suggestion for what an "enum" might look like for RPG.
// An enum that is really just a list of named constants
dcl-enum *n;
blue 'BLUE';
red 'RED';
yellow 'YELLOW';
end-enum;
paint = red;
// An enum that is basically a qualified named constant
dcl-enum categories qualified;
open 'OPEN';
closed 'CLOSED';
end-enum;
category = categories.open;
// A typed enum that can be used with LIKE
dcl-enum customer_type int(10);
ordinary 1;
special 2;
inactive 3 dft; // this is the default
end-enum;
dcl-s custType like(customerType); // initialized with 3 (the default)
// A qualified typed enum that can be used with LIKE
dcl-enum order_type char(10) qualified;
standard 'Std' dft; // this is the default
discount 'Discount';
end-enum;
dcl-s orderType like(orderType); // initialized with 'Std' (the default)
I think you could probably get most of what you want if IBM relaxed the rules such that a Template DS subfield could be used in a Like definition.
What features do you need that this would not fulfill?
That might be an interesting RFE. May you please share a coding example to give us better insight of it?