BookmarkSubscribeRSS Feed
bob021
Calcite | Level 5

Hi All

Can somebody help me with this?

I use this to calculate turnaround time for working days Mon. -  Fry.:

TAT = intck ('weekdays', recivedate, sentdate)

Is it possible to omit bank holydays for different countries in this statement?

Thank you in advance.

Bob

5 REPLIES 5
Ksharp
Super User

You can make a interval by yourself, then use this interval at intck()

bob021
Calcite | Level 5

Hi Ksharp

Thank you for quick respond.

I'm not sure how to make my own intervals. I found this  example for custom intervals  to omit holidays when counting business days in the function INTCK:

I don't know how to adjust this to my holiday list.

options intervalds=(BankingDays=BankDayDS);

data BankDayDS(keep=BEGIN);

  start = '15DEC1998'D;

  stop = '15JAN2002'D;

  nwkdays = INTCK('WEEKDAY',start,stop);

  do i = 0 to nwkdays;

  BEGIN = INTNX('WEEKDAY',start,i);

  year = YEAR(BEGIN);

  if BEGIN ne HOLIDAY("NEWYEAR",year) and

  BEGIN ne HOLIDAY("MLK",year) and

  BEGIN ne HOLIDAY("USPRESIDENTS",year) and

  BEGIN ne HOLIDAY("MEMORIAL",year) and

  BEGIN ne HOLIDAY("USINDEPENDENCE",year) and

  BEGIN ne HOLIDAY("LABOR",year) and

  BEGIN ne HOLIDAY("COLUMBUS",year) and

  BEGIN ne HOLIDAY("VETERANS",year) and

  BEGIN ne HOLIDAY("THANKSGIVING",year) and

  BEGIN ne HOLIDAY("CHRISTMAS",year) then

  output;

  end;

  format BEGIN DATE.;

run;

Bob

Peter_C
Rhodochrosite | Level 12

have a look at "Custom Time Intervals" at

http://support.sas.com/documentation/cdl/en/etsug/63939/HTML/default/viewer.htm#etsug_intervals_sect...

although it belongs among doc for SAS/ETS, it applies

art297
Opal | Level 21

Peter,

I have to wonder why intervalds was moved to the ETS documentation.  It has always been in the base SAS docs (e.g., http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a003252593.htm ).

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 5293 views
  • 3 likes
  • 5 in conversation