分类:
2008-09-29 10:21:52
Some examples of program exception/errors are: division by zero, SQRT of a negative number, invalid array index, error on a CALL, error return from called program, and start position or length out of range for a string operation. They can be handled in one of the following ways:
D SDS D PROC_NAME *PROC Procedure name D PGM_STATUS *STATUS Status code D PRV_STATUS 16 20S 0 Previous status D LINE_NUM 21 28 Src list line nu D ROUTINE *ROUTINE Routine name D PARMS *PARMS Num passed parms D EXCP_TYPE 40 42 Exception type D EXCP_NUM 43 46 Exception number D PGM_LIB 81 90 Program library D EXCP_DATA 91 170 Exception data D EXCP_ID 171 174 Exception Id D DATE 191 198 Date (DATE fmt) D YEAR 199 200S 0 Year (YEAR fmt) D LAST_FILE 201 208 Last file used D FILE_INFO 209 243 File error info D JOB_NAME 244 253 Job name D USER 254 263 User name D JOB_NUM 264 269S 0 Job number D JOB_DATE 270 275S 0 Date (UDATE fmt) D RUN_DATE 276 281S 0 Run date (UDATE) D RUN_TIME 282 287S 0 Run time (UDATE) D CRT_DATE 288 293 Create date D CRT_TIME 294 299 Create time D CPL_LEVEL 300 303 Compiler level D SRC_FILE 304 313 Source file D SRC_LIB 314 323 Source file lib D SRC_MBR 324 333 Source file mbr D PROC_PGM 334 343 Pgm Proc is in D PROC_MOD 344 353 Mod Proc is in D CURR_USER 358 367 Mod Proc is in
Status codes *STATUSNormal 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. 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/400 compiler or in run-time subroutines 09999 Program exception in system routine.