Desktop productivity for business analysts and programmers

Null Date

Reply
N/A
Posts: 0

Null Date

Hi,

I have run a query on the data supplied in my system. There was one record that the date against it was "." As this was in a field that should not be null I checked my data in the system against the Record Identifier there was a date in the system it was 08/08/0018 why did it not show up in the query output? Is there a certain date that EB doesn't recognize anything before it?

Thanks,
Valued Guide
Posts: 2,111

Re: Null Date

There is. It's described in the SAS system concepts help. SAS dates go back to sometime in the 1572, the start of the Gregorian calendar.
SAS Super FREQ
Posts: 8,720

Re: Null Date

Hi, you might also want to check the value of the YEARCUTOFF option for your session or installation configuration (using PROC OPTIONS). Is the year really 0018 or was there some kind of data input error?

cynthia
N/A
Posts: 0

Re: Null Date

If the source data is an external flat file (not a SAS dataset, not a database table) then there may be another issue at hand.

Check how you are reading the records in, there may be a mis-match in the field identification/parsing/delimiting/alignment. I habe been nabbed by this on many occasions, where a field is missing, and SAS skips across the missing field and values are then shifted left causing the right most field(s) to be missing, and numeric fields may be missing because a text field was there instead.

Make sure you have sufficient logging options on to trap conversions and datatype errors. It is possible to tell SAS not to report on input errors, which greatly speeds up processing, but also can cause you to miss input errors.
Frequent Contributor
Posts: 91

Re: Null Date

I think the clue is located in [checking Record ID]. You are reading from a relational database, like DB2 which allows dates like 08/08/0018, whereas noted earlier, SAS only goes back to 1582. If you check your log, (not sure if that is possible/easy in EG), you would probably see a note like:
NOTE: The data value for column DATE1 (DATE1) was truncated or was out of range 1 times when retrieving that data from the DBMS.
That's what caused your missing value. I just verified this with PC/SAS 9.1.3 and DB2.

So, the real question is...Is that a data entry error or do you have to figure out an alternate method for handling really old dates?
Ask a Question
Discussion stats
  • 4 replies
  • 187 views
  • 0 likes
  • 4 in conversation