Usage Note 41865: SAS date variables and day of week values
Several SAS date variable formats and a function return the day of the week to indicate the specific day (Sunday, Monday, ... Saturday) of a date. The day of the week formats and function work with dates starting in September 1752 and are accurate up to A.D. 19,900.
Dates before September 1752 will produce the incorrect day of the week. This is due to an adjustment made to the calendar in 1752 when Britain adopted the Gregorian calendar. In the month of September 1752, 11 days were omitted to make adjustments to the 10 days originally deleted by Pope Gregory XIII in 1582 and an extra leap year in 1700.
SAS formats that can produce the day of the week are DOWNAME, WEEKDATE, WEEKDATX, and WEEKDAY. SAS additionally has a format for SAS datetime variables to produce the day of the week called DTWKDATX. The SAS function that can produce the day of the week is called WEEKDAY.
Information about SAS date, time, and datetime values can be found in the SAS Language Reference: Concepts. The link is provided below:
SAS Date, Time, and Datetime Values
Further information about the calendar adjustment can be referenced in:
The Universal Almanac 1993, John W. Wright
The 1993 Almanac Information Please, 46th Edition
The Timetables of History, The New Third Revised Edition, Bernard Grun
Operating System and Release Information
SAS System | Base SAS | z/OS | | |
Z64 | | |
OpenVMS VAX | | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | | |
Microsoft Windows XP 64-bit Edition | | |
Microsoft® Windows® for x64 | | |
OS/2 | | |
Microsoft Windows 95/98 | | |
Microsoft Windows 2000 Advanced Server | | |
Microsoft Windows 2000 Datacenter Server | | |
Microsoft Windows 2000 Server | | |
Microsoft Windows 2000 Professional | | |
Microsoft Windows NT Workstation | | |
Microsoft Windows Server 2003 Datacenter Edition | | |
Microsoft Windows Server 2003 Enterprise Edition | | |
Microsoft Windows Server 2003 Standard Edition | | |
Microsoft Windows Server 2003 for x64 | | |
Microsoft Windows Server 2008 | | |
Microsoft Windows Server 2008 for x64 | | |
Microsoft Windows XP Professional | | |
Windows 7 Enterprise 32 bit | | |
Windows 7 Enterprise x64 | | |
Windows 7 Home Premium 32 bit | | |
Windows 7 Home Premium x64 | | |
Windows 7 Professional 32 bit | | |
Windows 7 Professional x64 | | |
Windows 7 Ultimate 32 bit | | |
Windows 7 Ultimate x64 | | |
Windows Millennium Edition (Me) | | |
Windows Vista | | |
Windows Vista for x64 | | |
64-bit Enabled AIX | | |
64-bit Enabled HP-UX | | |
64-bit Enabled Solaris | | |
ABI+ for Intel Architecture | | |
AIX | | |
HP-UX | | |
HP-UX IPF | | |
IRIX | | |
Linux | | |
Linux for x64 | | |
Linux on Itanium | | |
OpenVMS Alpha | | |
OpenVMS on HP Integrity | | |
Solaris | | |
Solaris for x64 | | |
Tru64 UNIX | | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
Type: | Usage Note |
Priority: | |
Topic: | SAS Reference ==> Formats ==> Date and Time ==> DOWNAME SAS Reference ==> Formats ==> Date and Time ==> WEEKDATE SAS Reference ==> Formats ==> Date and Time ==> WEEKDATX SAS Reference ==> Formats ==> Date and Time ==> WEEKDAY SAS Reference ==> Functions ==> Date and Time ==> WEEKDAY
|
Date Modified: | 2010-12-16 12:54:04 |
Date Created: | 2010-12-15 11:45:26 |