DATA Step, Macro, Functions and more

date handling below year 1582

Reply
Occasional Contributor
Posts: 12

date handling below year 1582

[ Edited ]
Hi Guys, Please help me out how to handle date below 1582.Its populating missing value whenever date is below 1582 year.
Super User
Posts: 7,771

Re: date handling below year 1582

In SAS, you can't.

SAS date and datetime formats do not accept numbers that point to a year before 1582.

It is also impossible to declare a date or datetime constant before 1582.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
SAS Super FREQ
Posts: 8,864

Re: date handling below year 1582

Hi:
From the doc:
http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/viewer.htm#a001397898.htm

"Note: SAS date values are valid for dates based on the Gregorian calendar from A.D. 1582 through A.D. 19,900. Use caution when working with historical dates. Although the Gregorian calendar was used throughout most of Europe from 1582, Great Britain and the American colonies did not adopt the calendar until 1752."

If you need to store dates outside of the acceptable range, then you might need to store them as character strings or as separate MONTH, DAY and YEAR numeric variables.

cynthia

ps -- this is an interesting user group presentation with more info/comments about dates: http://www.sas.com/content/dam/SAS/en_ca/User%20Group%20Presentations/Winnipeg-User-Group/Burchill-G...
Ask a Question
Discussion stats
  • 2 replies
  • 237 views
  • 0 likes
  • 3 in conversation