ILERPG.com β€” IBM i Β· ILE RPG Β· AS400 Mastery

This lesson is locked

A short preview is available. Purchase once for lifetime access.

Beginner Β· 18:36

Error Handling Foundations: MONITOR/ON-ERROR

An unhandled runtime error stops a program and leaves an inquiry message for an operator. This lesson covers the structured way to handle errors in ILE RPG: MONITOR groups with ON-ERROR clauses selected by status code, the (E) operation extender with %ERROR and %STATUS, and ON-EXIT for clean-up…

What you'll be able to do

  1. 1Write MONITOR/ON-ERROR/ENDMON groups that handle specific status codes, groups of codes, and the special values *PROGRAM, *FILE, and *ALL.
  2. 2Use the (E) operation extender with %ERROR and %STATUS on file and other operations, and decide when an extender is clearer than a MONITOR group.
  3. 3Identify common status codes β€” divide by zero, decimal data, invalid date, array index, duplicate key, record lock, and called-procedure failure β€” and define them as named constants.
  4. 4Use ON-EXIT to guarantee clean-up when a subprocedure ends normally or abnormally.
  5. 5Explain how an unhandled error in a subprocedure reaches its caller, and use the program status data structure to capture diagnostic information.

Create your account

Takes a few seconds β€” you'll be right back here after.

Sign in

Welcome back β€” you'll be right back here after.

Forgot your password?