HOLIDAYNAME Function

Returns the name of the holiday that corresponds to the SAS date or a blank string if a holiday is not defined for the SAS date.

Category:Date and Time
Restriction:This function is not valid on the CAS server.

Syntax

HOLIDAYNAME(date<,n<,'locale'>>)

Required Argument

date

specifies a SAS date value in the form 'ddmonyy'd or 'ddmonyyyy'd.

ddis a two-digit integer that represents the day of the month.
monis a three-character string that represents the month: JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC.
yy or yyyyis a two- or four-digit integer that represents the year. If only two digits are used, the YEARCUTOFF= option is valid.

Optional Arguments

n

specifies the index.

'locale'

specifies the POSIX locale value. See LOCALE= Values for PAPERSIZE and DFLANG Options in SAS Viya National Language Support: Reference Guide.

Details

The EVENTDS= option makes the date keys available. You can define the date keys with the DATEKEYS procedure. Also, you assign a locale to a date key with the DATEKEYS procedure. If you do not assign the locale to the date keys, then the predefined date keys do not have locales. If the locale argument is specified, then the date key must be defined using the DATEKEYS procedure, or a predefined date key needs to have a locale set that uses the DATEKEYS procedure. Then the new definition needs to be made available with the EVENTDS= system option.

Example

The following example specifies the name of the holiday:
data a;
   length Holiday $32;
   format date weekdatx17.;
   do year=2000 to 2010;
      date=mdy(11,11,year);
      ObsVetNov11=holidaycount(date);
      do index=1 to ObsVetNov11;
         Holiday=holidayname(date,index);
         output;
      end;
   end;
run;
proc print data=a;
run;
The Name of the Holiday That Corresponds to the SAS Date
The Name of the Holiday That Corresponds to the SAS Date
Last updated: March 16, 2017