As the first step in the decommissioning of sasCommunity.org the site has been converted to read-only mode.


Here are some tips for How to share your SAS knowledge with your professional network.


Tips:Use the HOLIDAY Function to Compute the Date of a US or Canadian Holiday

From sasCommunity
Jump to: navigation, search
data future_holidays;
label year = "Year"
    mothersday= "Mothers Day"
    presidentsday = "Presidents Day"
    victoriaday = "Victoria Day"
;
format mothersday presidentsday victoriaday worddate.;
do year = 2009 to 2019 by 1;
    mothersday = holiday("MOTHERS",year);
    presidentsday=holiday("USPRESIDENTS",year);
    victoriaday=holiday("VICTORIA",year);
    output;
end;
run;
 
proc print label;
run;

The HOLIDAY function allows you to determine the date of major US and Canadian holidays. You simply supply the HOLIDAY function with the holiday keyword and the year, and it will return the SAS date value. The syntax looks like this:

HOLIDAY('holiday', year)

See the simple example at right that computes three holidays for the next ten years:

There are currently twenty-two holiday keywords for the HOLIDAY function. You can read more about the HOLIDAY function in the

Submitted by Michael A. Raithel, The man who wrote the book on performance. Contact me at my Discussion Page.