OnDemand Users Group

Support Forums => CMOD for Multiplatforms => Topic started by: pankaj.puranik on July 29, 2013, 07:56:46 PM

Title: NULL dates
Post by: pankaj.puranik on July 29, 2013, 07:56:46 PM
If my date field is not an index or a segment field, is it possible to store null value in it?
If yes, how?
Title: Re: NULL dates
Post by: Justin Derrick on July 30, 2013, 04:12:09 PM
I'm not sure a 'null' date makes sense.  I'm not sure how you'd search for it, if you had to.

Maybe it's better used as a string field.

-JD.
Title: Re: NULL dates
Post by: Alessandro Perucchi on July 31, 2013, 08:27:48 AM
Strange enough I have some customer, when doing a arsdoc get for some migration, they get a NULL date on date fields.
Causing problem with arsload.
Apparently some old version of CMOD was less strict in accepting such formats...

But today, if you want NULL dates, then the only way is either use string field, OR if you want to keep the date field, then to define that a NULL date is 01.01.1970 (CMOD < V9.0) or 01.01.01 / 31.12.9999 (CMOD V9+).

Sincerely yours,
Alessandro
Title: Re: NULL dates
Post by: pankaj.puranik on July 31, 2013, 01:54:48 PM
In this particular case, we have 3 different dates. One of the dates that could be null in some cases is not used as a search field.
So we would probably make it a string field.
Title: Re: NULL dates
Post by: pankaj.puranik on July 31, 2013, 01:58:18 PM
Alessandro

I didn't get your point when you said

if you want NULL dates, then the only way is either use string field, OR if you want to keep the date field, then to define that a NULL date is 01.01.1970 (CMOD < V9.0) or 01.01.01 / 31.12.9999 (CMOD V9+).

Does this mean, i need to write some extra logic or probably use the default in Application and put the default date as 01.01.1970 (CMOD < V9.0) whenever I encounter a blank or invalid date in data?
Title: Re: NULL dates
Post by: Justin Derrick on August 01, 2013, 01:55:20 PM
That's exactly what he means.  You have to put in SOMETHING, so you might as well put in a date that 'approximates' zero.  On CMOD versions older than v9.0, the earliest date it can store is January 1st, 1970.  In CMOD v9, that date is January 1st, year 0001.

Here's more info on date formats in v9.0 if you're interested:

http://www-01.ibm.com/support/docview.wss?uid=swg27036188

-JD.
Title: Re: NULL dates
Post by: Alessandro Perucchi on August 07, 2013, 02:13:09 PM
Well Justin is reading correctly my mind :-)
Title: Re: NULL dates
Post by: jw on July 19, 2016, 05:06:34 PM
Hi all experts,

It has been almost 3 years since this post last updated.  I am just wondering whether the answer is still the same or newer version of CMOD provides a way to store NULL on date field.

Thanks in advance.

-jw
Title: Re: NULL dates
Post by: Alessandro Perucchi on August 02, 2016, 10:40:07 AM
Quote from: jw on July 19, 2016, 05:06:34 PM
Hi all experts,

It has been almost 3 years since this post last updated.  I am just wondering whether the answer is still the same or newer version of CMOD provides a way to store NULL on date field.

Thanks in advance.

No, even with the newest V9.5.0.X

And I don't think it will ever be possible.

If you require it, then please define precisely your use case, and poste in the "Enhancement" forum, or request to IBM a new feature for your use case.
Title: Re: NULL dates
Post by: Justin Derrick on August 02, 2016, 11:19:13 AM
But really, it doesn't make sense to store null dates in CMOD.  It's an archive, and an archive is mostly pointless if you can't reliably search it.  Having any field with a NULL in it makes it difficult to find -- especially a date field, which is strictly formatted.

-JD.
Title: Re: NULL dates
Post by: jw on August 02, 2016, 11:55:57 AM
Alessandro, Justin
Thanks for the info.
-jw