Functions and CALL Routines |
Category: | Date and Time |
Syntax | |
Arguments | |
Details | |
Comparisons | |
Examples | |
See Also |
Syntax |
HOLIDAY('holiday', year) |
is a character constant, variable, or expression that specifies one of the values listed in the following table.
Values for holiday can be in uppercase or lowercase.
Holiday Value | Description | Date Celebrated |
---|---|---|
BOXING | Boxing Day | December 26 |
CANADA | Canadian Independence Day | July 1 |
CANADAOBSERVED | Canadian Independence Day observed | July 1, or July 2 if July 1 is a Sunday |
CHRISTMAS | Christmas | December 25 |
COLUMBUS | Columbus Day | 2nd Monday in October |
EASTER | Easter Sunday | date varies |
FATHERS | Father's Day | 3rd Sunday in June |
HALLOWEEN | Halloween | October 31 |
LABOR | Labor Day | 1st Monday in September |
MLK | Martin Luther King, Jr. 's birthday | 3rd Monday in January beginning in 1986 |
MEMORIAL | Memorial Day | last Monday in May (since 1971) |
MOTHERS | Mother's Day | 2nd Sunday in May |
NEWYEAR | New Year's Day | January 1 |
THANKSGIVING | U.S. Thanksgiving Day | 4th Thursday in November |
THANKSGIVINGCANADA | Canadian Thanksgiving Day | 2nd Monday in October |
USINDEPENDENCE | U.S. Independence Day | July 4 |
USPRESIDENTS | Abraham Lincoln's and George Washington's birthdays observed | 3rd Monday in February (since 1971) |
VALENTINES | Valentine's Day | February 14 |
VETERANS | Veterans Day | November 11 |
VETERANSUSG | Veterans Day - U.S. government-observed | U.S. government-observed date for Monday-Friday schedule |
VETERANSUSPS | Veterans Day - U.S. post office observed | U.S. government-observed date for Monday-Saturday schedule (U.S. Post Office) |
VICTORIA | Victoria Day | Monday on or preceding May 24 |
is a numeric constant, variable, or expression that specifies a four-digit year. If you use a two-digit year, then you must specify the YEARCUTOFF= system option.
Details |
The HOLIDAY function computes the date on which a specific holiday occurs in a specified year. Only certain common U.S. and Canadian holidays are defined for use with this function. (See Holidays Recognized By SAS for a list of valid holidays.)
The HOLIDAY function returns a SAS date value. To convert the SAS date value to a calendar date, use any valid SAS date format, such as the DATE9. format.
Comparisons |
In some cases, the HOLIDAY function and the NWKDOM function return the same result. For example, the statement HOLIDAY('THANKSGIVING', 2007); returns the same value as NWKDOM(4, 5, 11, 2007); .
In other cases, the HOLIDAY function and the MDY function return the same result. For example, the statement HOLIDAY('CHRISTMAS', 2007); returns the same value as MDY(12, 25, 2007); .
Examples |
The following examples give these results:
See Also |
Functions: |
Copyright © 2011 by SAS Institute Inc., Cary, NC, USA. All rights reserved.