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.
It is very unlikely that this requirement will be implemented for RPG, so it is being closed.
However, there is already a way to deal with multi-format logical files without using I specs.
1. Define an INFDS for your file, so you can find out which record format was read.
2. Define an ordinary data structure for your file which you can use with EVAL-CORR to copy the data from the data structure in #4. This data structure will just list the fields from the file, without defining any types. It should not be qualified.
3. Define an externally-described data structure for each of the formats, using the EXTFLD keyword to handle renames.
4. Define another data structure with subfields defined with POS(1) and LIKEDS of these data structures. You could even define the sub-data structures directly as nested data structures, but this example defines separate data structure templates.
5. For your READ or CHAIN, specify the data structure from #4 in the result field of the opcode.
6. After the READ or CHAIN, use the INFDS to find out which format was read, and use EVAL-CORR to copy the subfields from the relevant subfield to the data structure defined in #2. Also, set the *INxx indicators, if your program uses them later.
dcl-f myfile infds(myfileInfds);
dcl-ds myfileInfds qualified; // #1
format *RECORD;
end-ds;
dcl-ds myfileFields; // #2
ItemNumber;
CustomerNumber;
...
end-ds;
dcl-ds L1Record_t extname('MYFILE' : 'L1RX') qualified template; // #3
ItemNumber extfld(l1item);
CustomerNumber extfld(l1cust);
end-ds;
dcl-ds L2Record_t extname('MYFILE' : 'L2RX') qualified template;
ItemNumber extfld(l2item);
CustomerNumber extfld(l2cust);
end-ds;
...
dcl-ds Records qualified; // #4
L1Record likeds(L1Record_t) pos(1);
L2Record likeds(L2Record_t) pos(1);
...
end-ds;
read myfile Records;
if not %eof(myfile);
if myfileInfds.format = 'L1RX';
eval-corr myfileFields = Records.L1Recod;
*in01 = *on;
elseif myfileInfds.format = 'L2RX';
eval-corr myfileFields = Records.L2Recod;
*in02 = *on;
...
endif;
endif;
if CustomerNumber > 1000; // now you can work with the fields
For example
dcl-ds
Regarding renaming fields, do you have alternate names for those fields in your actual file? If so, you could code the ALIAS keyword on your RPG file definition, and pick up the alternate names instead of the short names.
I appreciate the comments & totally agree with new development, other methods could & should be used.
I'm just dealing with some old code that had some multi-member logic that utilized I-Specs from a software vendor & just thought if other people were dealing with the same situation, it wouldn't hurt to submit an RFE for consideration.
"Going backwards" was not my intention & I did clarify the request to indicate that I'm not looking to ADD i-specs to modern RPG - just emulate some of its functionality with new keyword(s) within a DCL-DS or similar.
I agree with Jon's comments below. Let's not move backwards. Move forward and use more SQL in our RPG programs.
Jason
There are other ways to handle such files without having to go back to I-specs surely? Using reading into a DS with multiple definitions springs to mind. Or having multiple pointer based DSs one for each record format. Either way I don't want to start moving backwards.