Hi Bsidmis,
Hmm was not a very clear answer I suppose :)
What I tried to explain, is that most of the errors you handle in CL, are CPF messages catched with a MONMSG. these are all messages from commands.
From RPG you can't execute commands other then a call to QCMDEXEC, what is not a command but a call.
So in RPG there is not such a thing as MONMSG, but the status code (or status function) covers it the following way (copy from manual):
Regards,
Murph
C
* The 'E' extender indicates that if an error occurs, the error
* is to be handled as though an error indicator were coded.
* The success of the operation can then be checked using the
* %ERROR built-in function. The status associated with the error
* can be checked using the %STATUS built-in function.
C EXFMT(E) INFILE
C IF %ERROR
C EXSR CheckError
C ENDIF
C ...
*-------------------------------------------------------------------
* CheckError: Subroutine to process a file I/O error
*-------------------------------------------------------------------
C CheckError BEGSR
C SELECT
C WHEN %STATUS < 01000
* No error occurred
C WHEN %STATUS = 01211
* Attempted to read a file that was not open
C EXSR InternalError
C WHEN %STATUS = 01331
* The wait time was exceeded for a READ operation
C EXSR TimeOut
C WHEN %STATUS = 01261
* Operation to unacquired device
C EXSR DeviceError
C WHEN %STATUS = 01251
* Permanent I/O error
C EXSR PermError
C OTHER
* Some other error occurred
C EXSR FileError
C ENDSL
C ENDSR
*---- Errorlist:
Normal Codes
Code Condition
00000 No exception/error occurred
00001 Called program returned with the LR indicator on.
Exception/Error Codes
Code Condition
00100 Value out of range for string operation
00101 Negative square root
00102 Divide by zero
00103 An intermediate result is not large enough to contain the result.
00104 Float underflow. An intermediate value is too small to be contained in the intermediate result field.
00112 Invalid Date, Time or Timestamp value.
00113 Date overflow or underflow. (For example, when the result of a Date calculation results in a number greater than *HIVAL or less than *LOVAL.)
00114 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.
00115 Variable-length character or graphic field has a current length that is not valid.
00120 Table or array out of sequence.
00121 Array index not valid
00122 OCCUR outside of range
00123 Reset attempted during initialization step of program
00202 Called program or procedure failed; halt indicator (H1 through H9) not on
00211 Error calling program or procedure
00222 Pointer or parameter error
00231 Called program or procedure returned with halt indicator on
00232 Halt indicator on in this program
00233 Halt indicator on when RETURN operation run
00299 RPG IV formatted dump failed
00333 Error on DSPLY operation
00401 Data area specified on IN/OUT not found
00402 *PDA not valid for non-prestart job
00411 Data area type or length does not match
00412 Data area not locked for output
00413 Error on IN/OUT operation
00414 User not authorized to use data area
00415 User not authorized to change data area
00421 Error on UNLOCK operation
00425 Length requested for storage allocation is out of range
00426 Error encountered during storage management operation
00431 Data area previously locked by another program
00432 Data area locked by program in the same process
00450 Character field not entirely enclosed by shift-out and shift-in characters
00501 Failure to retrieve sort sequence.
00502 Failure to convert sort sequence.
00802 Commitment control not active.
00803 Rollback operation failed.
00804 Error occurred on COMMIT operation
00805 Error occurred on ROLBK operation
00907 Decimal data error (digit or sign not valid)
00970 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.
09998 Internal failure in ILE RPG compiler or in run-time subroutines
09999 Program exception in system routine.
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101:





by: murphey2Posted on 2008-12-03 at 07:15:45ID: 23086689
Hi Bsidmis,
What kind of error messages you like to trap,
the error messages in CL are (the most of the time) totally different kind of calls or commands.
Please give an example.
Regrads,
Murph