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.
You can now specify a global named constant for an ON-EXCP statement in a subrocedure.
The following PTFs provide this support:
7.3:
ILE RPG compiler: 5770WDS SI83429
7.4:
ILE RPG compiler: 5770WDS SI83497
ILE RPG compiler, TGTRLS(V7R3M0): 5770WDS SI83483
7.5:
ILE RPG compiler: 5770WDS SI83480
ILE RPG compiler, TGTRLS(V7R4M0): 5770WDS SI83496
ILE RPG compiler, TGTRLS(V7R3M0): 5770WDS SI83494
- IBM Power Systems Development
Just an idea
It is possible to specify several individual message ids on the on-excp statement.
You could enhance it to monitor for a range of message ids using the %range() function.
like this:
on-excp %range('ERR1234' : 'ERR1239');
If the named constant is defined in the subprocedure, that also works now.
dcl-proc subp;
dcl-c ERR_CUSTOMER_NOT_FOUND 'ERR1234';
monitor;
on-excp ERR_CUSTOMER_NOT_FOUND; // ok
endmon;
end-proc;
But ... if the constants are in a copy file, it's not ideal to copy the constants into every subprocedure.
As a temporary circumvention, you could keep the /copy in the global definitions, and create a temporary copy file that just has a /copy of your constants. Then add a /copy statement with the temporary copy file in each of the subprocedures that needs the constants. When this Idea is implemented, you could scan your code for the temporary copy file and remove the extra /copy statements, leaving only the real /copy statement in the global definitions. That way, you would not have to wait to code the named constants in the ON-EXCP statements.
/copy constants
dcl-proc subp;
/copy temp_constants // remove this /copy when IBMI-I-3567 is implemented
monitor;
on-excp ERR_CUSTOMER_NOT_FOUND;
endmon;
end-proc;
- Barbara Morris
Ok, thanks. We don't write much code in cycle main anymore. Support for named constants in procedures would be appreciated :)
Note that the RPG compiler does support named constants in general for ON-EXCP, but it does not support global named constants in a subprocedure.
The following source compiles:
dcl-c ERR_CUSTOMER_NOT_FOUND 'ERR1234';
monitor;
on-excp ERR_CUSTOMER_NOT_FOUND;
endmon;
return;
The following source does not compile. Message RNF0203 is issued against the ON-EXCP statement in the subprocedure.
dcl-c ERR_CUSTOMER_NOT_FOUND 'ERR1234';
subp();
return;
dcl-proc subp;
monitor;
on-excp ERR_CUSTOMER_NOT_FOUND; // RNF0203
endmon;
end-proc;
- IBM Power Systems Development