I am trying to find the diff between two dates excluding weekends using intck ('weekday',date 1, date2) however i need to know how to exclude the below holidays between
the dates
Value Amerhol
'24Dec2013'D,
'25Dec2013'D,
'31Dec2013'D,
'1Jan2014'D = 1
OTHER=0;
Hi , Try this. it excludes weekends and holidays.
data holiday;
input holiday date9.;
cards;
24Dec2013
25Dec2013
31Dec2013
01Jan2014
;
data real_date;
input real_date date9.;format real_date date9.;
cards;
20Dec2013
21Dec2013
22Dec2013
23Jan2013
24Dec2013
25Dec2013
26DEC2013
27DEC2013
28DEC2013
29DEC2013
30Dec2013
31DEC2013
01JAN2014
02JAN2014
05JAN2014
10JAN2014
12JAN2014
14JAN2014
15JAN2014
;
proc sql noprint;
select holiday into :holiday separated by ',' from holiday;
quit;
data test;
set real_date(where=(weekday(real_date) not in (1,7) and real_date not in (&holiday.)));
Diff=intck('day','14JAN2014'd,real_date);
run;
Thank you Pradeep. What i am needing is that the date range will be in fiscal week : for ex :- fiscal week 201440 ( nov'13 ) till fiscal week 201448 ( dec'13) my question is do i need to list each day?
i am having a calculated function intck ('weekday',date 1, date2) which is giving the working days between fiscal week 201440 ( 2nd nov'13 ) till fiscal week 201448 ( 3rdJan'14). for the same date range i need to calculate the working days without holidays below.
11Nov2013
22Nov2013
23Nov2013
24Dec2013
25Dec2013
1Jan2014
Here's a SAS function that can do the work.
Calculating the number of working days between two dates - The SAS Dummy
Chris
you need 2 different dates in some form, if you want to compare/find difference between them.
you can loop through the date range between your fiscal weeks( start date to your end date), then you don't have to list each day.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: