Dins un bloc monitoritzat amb MONITOR a RPGLE, si hi ha cap excepció, tindrem el codi d’excepció a la variable %STATUS.
Aquest codi pot ser:
No exception/error occurred
Called program returned with the LR indicator on.
Conversion resulted in substitution.
Value out of range for string operation
Negative square root
Divide by zero
An intermediate result is not large enough to contain the result.
Float underflow. An intermediate value is too small to be contained in the intermediate result field.
Invalid characters in character to numeric conversion functions.
Invalid Date, Time or Timestamp value.
Date overflow or underflow. (For example, when the result of a Date calculation results in a number greater than *HIVAL or less than *LOVAL.)
Date mapping errors, where a Date is mapped from a 4-character year to a 2-character year, and the date range is not 1940-2039.
Variable-length field has a current length that is not valid.
Table or array out of sequence.
Array index not valid
OCCUR outside of range
Reset attempted during initialization step of program
Called program or procedure failed; halt indicator (H1 through H9) not on
Error calling program or procedure
Pointer or parameter error
Called program or procedure returned with halt indicator on
Halt indicator on in this program
Halt indicator on when RETURN operation run
RPG IV formatted dump failed
Class or method not found for a method call, or error in method call.
Error while converting a Java array to an RPG parameter on entry to a Java native method.
Error converting RPG parameter to Java array on exit from an RPG native method.
Error converting RPG parameter to Java array in preparation for a Java method call.
Error converting Java array to RPG parameter or return value after a Java method.
Error converting RPG return value to Java array.
Error on DSPLY operation
Error parsing XML document
Invalid option for %XML
XML document does not match RPG variable
Error preparing for XML parsing
Data area specified on IN/OUT not found
*PDA not valid for non-prestart job
Data area type or length does not match
Data area not locked for output
Error on IN/OUT operation
User not authorized to use data area
User not authorized to change data area
Error on UNLOCK operation
Length requested for storage allocation is out of range
Error encountered during storage management operation
Data area previously locked by another program
Data area locked by program in the same process
Character field not entirely enclosed by shift-out and shift-in characters
Conversion between two CCSIDs is not supported.
Failure to retrieve sort sequence.
Failure to convert sort sequence.
Commitment control not active.
Rollback operation failed.
Error occurred on COMMIT operation
Error occurred on ROLBK operation
Decimal data error (digit or sign not valid)
The level number of the compiler used to generate the program does not agree with the level number of the RPG IV run-time subroutines.
Internal failure in ILE RPG compiler or in run-time subroutines
Program exception in system routine.
Table 8. Exception/Error Codes
Code Device1 RC2 Condition
01011 W,D,SQ n/a Undefined record type (input record does not match record identifying indicator).
01021 W,D,SQ n/a Tried to write a record that already exists (file being used has unique keys and key is duplicate, or attempted to write duplicate relative record number to a subfile).
01022 D n/a Referential constraint error detected on file member.
01023 D,SQ n/a Error in trigger program before file operation performed.
01024 D,SQ n/a Error in trigger program after file operation performed.
01031 W,D,SQ n/a Match field out of sequence.
01041 n/a n/a Array/table load sequence error.
01042 n/a n/a Array/table load sequence error. Alternate collating sequence used.
01051 n/a n/a Excess entries in array/table file.
01071 W,D,SQ n/a Numeric sequence error.
011214 W n/a No indicator on the DDS keyword for Print key.
011224 W n/a No indicator on the DDS keyword for Roll Up key.
011234 W n/a No indicator on the DDS keyword for Roll Down key.
011244 W n/a No indicator on the DDS keyword for Clear key.
011254 W n/a No indicator on the DDS keyword for Help key.
011264 W n/a No indicator on the DDS keyword for Home key.
01201 W 34xx Record mismatch detected on input.
01211 all n/a I/O operation to a closed file.
01215 all n/a OPEN issued to a file already opened.
012163 all yes Error on an implicit OPEN/CLOSE operation.
012173 all yes Error on an explicit OPEN/CLOSE operation.
01218 D,SQ n/a Record already locked.
01221 D,SQ n/a Update operation attempted without a prior read.
01222 D,SQ n/a Record cannot be allocated due to referential constraint error
01231 SP n/a Error on SPECIAL file.
01235 P n/a Error in PRTCTL space or skip entries.
01241 D,SQ n/a Record number not found. (Record number specified in record address file is not present in file being processed.)
01251 W 80xx 81xx Permanent I/O error occurred.
01255 W 82xx 83xx Session or device error occurred. Recovery may be possible.
01261 W n/a Attempt to exceed maximum number of acquired devices.
01271 W n/a Attempt to acquire unavailable device
01281 W n/a Operation to unacquired device.
01282 W 0309 Job ending with controlled option.
01284 W n/a Unable to acquire second device for single device file
01285 W 0800 Attempt to acquire a device already acquired.
01286 W n/a Attempt to open shared file with SAVDS or IND options.
01287 W n/a Response indicators overlap IND indicators.
01299 W,D,SQ yes Other I/O error detected.
01331 W 0310 Wait time exceeded for READ from WORKSTN file.
"Device" refers to the devices for which the condition applies. The following abbreviations are used: P = PRINTER; D = DISK; W = WORKSTN; SP = SPECIAL; SQ = Sequential. The major/minor return codes under column RC apply only to WORKSTN files.
The formula mmnn is used to described major/minor return codes: mm is the major and nn the minor.
Any errors that occur during an open or close operation will result in a *STATUS value of 1216 or 1217 regardless of the major/minor return code value.
See Figure 9 for special handling.
En aquesta plana de Midrange els trobarem tots i en forma de constants.