HOLIDAYTEST Function
Returns 1 if the holiday occurs on the SAS date value.
| Category: | Date and Time |
| Restriction: | This function is not valid on the CAS server. |
Syntax
Required Arguments
'holiday'
is a character constant, variable, or expression that specifies one of the values that are listed in the following table. The holiday variable can also be defined using the DATEKEYS procedure and is made available to the function that uses the EVENTDS= system option.
|
Holiday Value
|
Description
|
Date Celebrated
|
|---|---|---|
|
BOXING
|
Boxing Day
|
December 26
|
|
CANADA
|
Canada Day
|
July 1
|
|
CANADAOBSERVED
|
Canada 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
|
date
specifies the beginning date value in the form ‘ddmonyy’d or ‘ddmonyyyy’d.
| dd | is a two-digit integer that represents the day of the month. |
| mon | is a three-character string that represents the month: JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC. |
| yy or yyyy | is a two- or four-digit integer that represents the year. If only two digits are used, the YEARCUTOFF= option is valid. |
Optional Argument
'locale'
specifies the POSIX locale value. See LOCALE= Values for PAPERSIZE and DFLANG Options in SAS Viya National Language Support: Reference Guide.
Details
Example
data a;
length is $9;
holiday='Christmas';
test=holidaytest(holiday,today());
if (test=1) then is='today';
else is='not today';
put holiday= is=;
run;holiday=Christmas is=not today