BookmarkSubscribeRSS Feed
kalpanaganga18
Calcite | Level 5

Hi all,

When I am trying to get Juneteenth date using SAS Holiday() function no date is returning and I see below error message:

Is this  a known issue. SAS has any fix. I am using SAS 9.4.

 

Code:

DATA test;
format Juneteenth_Day mmddyy10.;
Juneteenth_Day = holiday('Juneteenth' , 2023);
run;

Error Message:

WARNING: In a call to the HOLIDAY function or routine, the date keyword Juneteenth was not defined using the EVENTDS system option.
NOTE: Argument 1 to function HOLIDAY('Juneteenth',2023) at line 34 column 21 is invalid.
Juneteenth_Day= _ERROR_=1 _N_=1

2 REPLIES 2
Tom
Super User Tom
Super User

You probably need to install a new maintenance release.  9.4 was first released long before Juneteenth was made an official national holiday.

https://blogs.sas.com/content/iml/2013/08/02/how-old-is-your-version-of-sas-release-dates-for-sas-so...

Old          9.4      10Jul2013 12.3
Old          9.4m1    15Dec2013 13.1
Old          9.4m2    05Aug2014 13.2
Modern       9.4m3    14Jul2015 14.1
Modern       9.4m4    16Nov2016 14.2
Modern       9.4m5    19Sep2017 14.3
Recent       9.4m6    20Nov2018 15.1
Recent       9.4m7    18Aug2020 15.2
Recent       9.4m8    31Jan2023 15.3

Does not work in 9.4M7 version used SAS ODA.

 69         %put &=sysvlong;
 SYSVLONG=9.04.01M7P080620
 70         data _null_;
 71            date = holiday('Juneteenth', 2023);
 72            put date= date9.;
 73         run;
 
 WARNING: In a call to the HOLIDAY function or routine, the date keyword Juneteenth was not defined using the EVENTDS system option.
 NOTE: Argument 1 to function HOLIDAY('Juneteenth',2023) at line 71 column 11 is invalid.
 date=.
 date=. _ERROR_=1 _N_=1

Perhaps it would work in SAS 9.4M8?

 

In the meantime you could try calculating it yourself.  It behaves like the 4th of July holiday when it falls on a week-end in terms of days off.

data _null_;
 do year=2021 to 2031;
   date = mdy(6,19,year);
   if weekday(date)=7 then date+-1;
   else if weekday(date)=1 then date+1;
   put date= weekdate29. ;
 end;
run;
date=Friday, June 18, 2021
date=Monday, June 20, 2022
date=Monday, June 19, 2023
date=Wednesday, June 19, 2024
date=Thursday, June 19, 2025
date=Friday, June 19, 2026
date=Friday, June 18, 2027
date=Monday, June 19, 2028
date=Tuesday, June 19, 2029
date=Wednesday, June 19, 2030
date=Thursday, June 19, 2031

 

kalpanaganga18
Calcite | Level 5

Thanks for you quick reply Tom. Yes we 9.4M7 and not working.

I raised a ticket with SAS they confirmed fix is in M8.

Meanwhile I tried, Juneteenth_Day = (holiday('USINDEPENDENCE' , 2023))-15; I tried USINDEPENDENCE since it will be always July4th. If I subtract 15days I am getting June19th.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 892 views
  • 0 likes
  • 2 in conversation