Nice Subprocedures with RPG ON-EXIT
IBM is adding all kinds of new tweaks to RPG with each new release of IBM i. RPG ON-EXIT is a great example of a neat tweak to the RPG programming language.
Last year, IBM quietly introduced a rather neat new function called “ON-EXIT” to our sub procedures in RPG.
RPG ON-EXIT is a nice structured way of storing procedure house keeping and/or error catching.
ON-EXIT is available if you are running IBM i V7.2 or higher:
The ILE RPG compiler is enhanced with a new ON-EXIT opcode which begins the “ON-EXIT” section containing code to be run whenever a procedure ends, either normally or abnormally.
So, if you have code that you always want to run at the end of a procedure you can just put that in the ON-EXIT section.
So how does ON-EXIT work?
It works like this
Learning Something New
“I am always ready to learn although I do not always like being taught.” — Winston Churchill
- All courses…
- Topics
- Modernization
- IBM i | AS400 | iSeries
- WordPress
- Access restrictions
- MEMBERS ONLY
- Free For All
56 Lessons – Easy
Not started
RPG Programming for Beginners.
Aimed at programmers that have (a) no knowledge of the RPG ILE language or (b) knowledge of older RPG versions and want to upgrade to modern ILE Web powerful RPGLE.