11-29-2015 08:23 PM
I used the code:
do date="&start_date"d to "&end_date"d;
format date date9.;
But, SAS don't recognize the date before 1600-01-01.
Does anyone know how to solve this?
11-29-2015 09:06 PM
Why do you want to store invalid dates?
Are you using them as some type of special missing value? If so then pick a different date that can be stored in a SAS date variable.
Otherwise just work with your dates as either strings or three separate year, month and day variables.
11-29-2015 09:53 PM
11-29-2015 11:05 PM
Not sure I'm clear on the exact issue you mentioned....
" I want to check if the data I use are the coresponding date."
Would you be able to elaborate with an example of the challenge you have?
11-29-2015 09:37 PM
It becomes very messy to deal with pre-18th century dates, before the adoption of our regular calendar. SAS will not do that for you.
If you really need them, use year, month, day values and good luck
11-29-2015 11:55 PM
This is what I would try. If the foreign date system considers 01-01-0001 as day zero then foreignDate-584388 should give you the corresponding SAS date. If 01-01-0001 is day one then that expression should be foreignDate-584389.
-584388 is '01JAN1600'd - '01JAN3200'd
11-30-2015 11:48 AM
Yes, SAS could only recognize the dates after 1600.
I did this in excel.
You need to double check what Excel may have done. It doesn't recognize dates by default before 1900, at least on my install. I suspect you ended up with a TEXT value in Excel not an actual date. See what happens if you change the cell format in Excell to display a different date format.