Written by

Collabera Technologies Limited
Question Fahima Ansari · May 2, 2025

I am getting date as 00010101 in CCDA if we use $ZDATEH function it is giving value out of range error

Can anyone please help me which function i can use to handle this error.

Product version: IRIS 2025.1

Comments

Ashok Kumar T · May 2, 2025

$ZDateH is used to convert the actual date into IRIS internal Horolog format. You can use $ZDate convert the Horolog to date format. The start date is $ZDate(0) = "12/31/1840" $ZDH("12/31/1840") = 0. If the date is earlier than the allowed range, it throws a 'VALUE OUT OF RANGE' error.

0
Fahima Ansari  May 2, 2025 to Ashok Kumar T

Do you have any solution to handle this date 00010101?

0
Ashok Kumar T  May 2, 2025 to Fahima Ansari

It depends on your implementation. you can add some conditions like if the date is "00010101" then convert to "1840-12-31" and use that date into $ZDH ($ZDH("1840-12-31",3)) or skip the $ZDH conversion and set 0 directly. 

0
Enrico Parisi  May 2, 2025 to Fahima Ansari

What date 00010101 represent?!

To me looks like a wrong date......how do you want to handle it??

0
Steven Hobbs · May 2, 2025

The default 'mindate' value for the $ZDATE(hdate,dformat,monthlist,yearopt,startwin,endwin,mindate,maxdate,erropt,localeopt)
system function call is 0, which represents 1840-12-31.  However, you can supply your own 'mindate' argument with negative values down -672045 which does date conversions more distantly into the past.

USER>zwrite $zdate(-672045,3,,,,,-672045)  
"0001-01-01"

which is Gregorian date January 1st in the year 0001 CE.  (That is the first day, in the first month in the first year of the first century.)  I should note that the Gregorian calendar was not in use back in the year 0001 CE but I don't think IRIS has support for Julius Caesar's calendar.  Passing a 'mindate' argument value more negative than -672045 will get you an <ILLEGAL VALUE> signal from $ZDATE() because there is some debate about whether the previous year is 0000 CE, -0001 CE or +0001 BCE.

0