News
Abstract
Information about the PTFs for the ILE RPG enhancement that supports generatic message IDs in the form 'ABC*' for the ON-EXCP operation code
Content
You are in: RPG Cafe > RPG Cafe: 2026-07: Generic message IDs for ON-EXCP
Short URL: https://ibm.biz/rpgcafe_2026_07_on_excp_generic_msgid
Generic message IDs for ON-EXCP
Warning If you use any generic message IDs with ON-EXCP in your program, you need a runtime PTF on any system where you run the program. |
Details
A generic message ID must have a length between 1 and 7. It contains
- Zero or more letters and numbers
- One asterisk
- Zero or more blanks are allowed but not necessary
Examples:
| ON-EXCP '*'; | Monitors for any message ID |
| ON-EXCP 'A*'; | Monitors for any message ID beginning with "A" |
| ON-EXCP 'ABC*'; | Monitors for any message ID beginning with "ABC" |
| ON-EXCP 'ABC123*'; | Monitors for any message ID beginning with "ABC123" |
If more than one ON-EXCP statement matches a particular message ID, the first ON-EXCP with a match handles the exception. For example, in the following MONITOR group, if message 'ABC1234' is issued, it is handled by the ON-EXCP statement that is monitoring for "ABC12*". The later ON-EXCP statement that is monitoring explicitly for "ABC1234" does not get control because the earlier statement matches the message ID.
monitor; create_new_account (); on-excp 'ABC12*' : 'DEF1234'; // handle messages starting with "ABC12" and message "DEF1234" on-excp 'ABC1234'; // handle "ABC1234" endmon;
.
.
PTFs for 7.5 and 7.6:
Warning: If you use a generic message ID for ON-EXCP in your program, you need a runtime PTF on every system where the program runs. If the runtime PTF is not applied on the system where the program is running, the calling program fails with MCH4437 saying that a program export is not found.
7.5:
ILE RPG runtime: 5770SS1 SJ10448
Note: You need this PTF on any 7.5 system where you run a program with an ON-EXCP statement with a generic message ID.
- ILE RPG compiler: 5770WDS SJ10450
7.6:
ILE RPG runtime: 5770SS1 SJ10449
Note: You need this PTF on any 7.6 system where you run a program with an ON-EXCP statement with a generic message ID.
- ILE RPG compiler: 5770WDS SJ10455
- ILE RPG compiler, TGTRLS(V7R5M0): 5770WDS SJ10460
RDi support
The next update for RDi will support this enhancement.
Documentation
The 7.5 and 7.6 ILE RPG Reference and ILE RPG Programmer's Guide are updated with full information about this enhancement. Start at the "What's new since 7.5", or "What's new since 7.6" section in the Reference.
- What's new since 7.5? https://www.ibm.com/docs/en/ssw_ibm_i_75/rzasl/rpgrelv7r5post.htm
- What's new since 7.6? https://www.ibm.com/docs/en/ssw_ibm_i_76/rzasl/rpgrelv7r6post.htm
Was this topic helpful?
Document Information
Modified date:
17 July 2026
UID
ibm17276358