Possible error situations

  1. For subtracting durations:
    • If the value of the Date, Time or Timestamp field in factor 1 is invalid
    • If factor 1 is blank and the value of the result field before the operation is invalid
    • or if the result of the operation is greater than *HIVAL or less than *LOVAL.
  2. For calculating durations:
    • If the value of the Date, Time or Timestamp field in factor 1 or factor 2 is invalid
    • or if the result field is not large enough to hold the resulting duration.

In each of these cases an error will be signalled.

If an error is detected, an error will be generated with one of the following program status codes:

The value of the result field remains unchanged. To handle exceptions with program status codes 103, 112 or 113, either the operation code extender 'E' or an error indicator ER can be specified, but not both. For more information on error handling, see Program Exception/Errors.