Skip to main content

erropt

erropt

Specifying a value for this argument suppresses errors associated with invalid or out of range hdatetime values. Instead of generating <ILLEGAL VALUE> or <VALUE OUT OF RANGE> errors, the $ZDATETIME function returns the erropt value.

  • Validation: InterSystems IRIS performs canonical numeric conversion on hdatetime. The date and time portions of hdatetime are parsed separately. It parses the first comma encountered as the date/time separator. Additional commas are treated as non-numeric characters.

    Parsing of each portion of an hdatetime string halts at the first non-numeric character. Therefore, an hdatetime such as 64687AD,1234SECS is the same as 64687,1234. A non-numeric date or time portion (including the null string) evaluates to 0. Thus an empty string hdatetime returns the $HOROLOG initial date: December 31, 1840.

    However, if the date portion value does not evaluate to an integer (contains a non-zero fractional number) it generates an <ILLEGAL VALUE> error.

  • Range: The date portion of hdatetime must evaluate to an integer within the mindate/maxdate range. By default, date values greater than 2980013 or less than 0 generate a <VALUE OUT OF RANGE> error. By setting mindate to a negative number, you can extend the range of valid dates before December 31, 1840. However, for dformat 18, 19, 20, or 21 (Hijri Islamic calendar) dates, any date prior to -445031 generates an <ILLEGAL VALUE> error, even if mindate is set to an earlier date.

    A time portion of hdatetime with a value greater than 86399 generates an <ILLEGAL VALUE> error. A negative hdatetime time value generates an <ILLEGAL VALUE> error.

The erropt argument only suppresses errors generated due to invalid or out of range values of hdatetime. Errors generated due to invalid or out of range values of other arguments will always generate errors whether or not erropt has been supplied. For example, an <ILLEGAL VALUE> error is always generated when $ZDATETIME specifies a sliding window where endwin is earlier than startwin. Similarly, an <ILLEGAL VALUE> error is generated when maxdate is less than mindate.

FeedbackOpens in a new tab