HOLIDAY Function

Returns a SAS date value of a specified holiday for a specified year.

Category: Date and Time

Syntax

HOLIDAY('holiday', year)

Required Arguments

'holiday'

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 Values and Their Descriptions
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

year

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 Holiday Values and Their Descriptions for a list of valid holidays.)
The definition of many holidays has changed over the years. In the U.S., Executive Order 11582, issued on February 11, 1971, fixed the observance of many U.S. federal holidays.
The current holiday definition is extended indefinitely into the past and future, although many holidays have a fixed date at which they were established. Some holidays have not had a consistent definition in the past.
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);.

Example

The following SAS statements produce these results.
SAS Statement
Result
thanks = holiday('thanksgiving', 2007);
format thanks date9.;
put thanks;
22NOV2007
boxing = holiday('boxing', 2007);
format boxing date9.;
put boxing;
26DEC2007
easter = holiday('easter', 2007);
format easter date9.;
put easter;
08APR2007
canada = holiday('canada', 2007);
format canada date9.;
put canada;
01JUL2007
fathers = holiday('fathers', 2007);
format fathers date9.;
put fathers;
17JUN2007
valentines = holiday('valentines', 2007);
format valentines date9.;
put valentines;
14FEB2007
victoria = holiday('victoria', 2007);
format victoria date9.;
put victoria;
21MAY2007

See Also