| Error handling with QCMDEXC |
|
|
|
Q: In your RPG IV Modules, Procedures & Service Programs presentation, there is an example showing how to use QCMDEXC in a prototype. If an error occurred while executing this code is there a way to handle it internally? A: Here's an example of catching an error in this scenario... D Gocmd PR Extpgm('QCMDEXC')
You could also use the (e) extender on the CALLP to Gocmd, instead of using Monitor. If you wanted to catch a more specific error, positions 40-46 of the program status data structure holds the error message identifier: D SDSD Errmsgid 40 46 Or, you could to receive a message from the command, maybe using an API in a wrapper procedure. |
Special pricing for the Glendora area. Book a 5-day onsite class for as little as USD $800/day. Get a price quote today. Ask for offer CA800.
5-day minimum, special terms apply.