Let SAS Help You Plan Your Next Holiday
It is possible to use SAS to calculate which date a national holiday is on in a given year.
The HOLIDAY function will return the SAS date of a common holiday. This means that we could do comparisons with these dates and work out whether a certain national holiday has passed, or is yet to happen.
The first argument should be a character value which is the name of the holiday you're investigating. The second argument is the year of interest - this has to be a numeric value.
The value returned will be a SAS date value.
Below is an example of some dates for the 2014 diary:
data holidays; year=2014; valentines = holiday('valentines', year); easter = holiday('easter', year); halloween = holiday('halloween', year); christmas = holiday('christmas', year); format valentines easter halloween christmas weekdatx.; put "Valentine's Day " year "is " valentines; put "Easter Day " year "is " easter; put "Halloween " year "is " halloween; put "Christmas Day " year "is " christmas; run;
Valentine's Day 2014 is Friday, 14 February 2014 Easter Day 2014 is Sunday, 20 April 2014 Halloween 2014 is Friday, 31 October 2014 Christmas Day 2014 is Thursday, 25 December 2014
Note that some dates will be returned as the U.S/Canadian version, but there are numerous holidays which apply to the rest of the world also.
A full list of Holidays available and more information about the HOLIDAY function can be found on support.sas.com.