Help using Base SAS procedures

Getting the second to last working day

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 75
Accepted Solution

Getting the second to last working day

I'm trying to get the second to last working day of any month , regardless of the holidays.

I've tried with that code but I got stuck especially with the intnx, which is giving me the last day...

data tata; test=today();

put test=;

run;

data toto;

set tata;

lastDay=intnx('month',"test"d,0,'E');

format lastDay ddmmyy10.;

run;

I'm welcoming any tips that will unlock me.


Accepted Solutions
Solution
‎07-31-2014 12:01 PM
Occasional Contributor
Posts: 17

Re: Getting the second to last working day

You already have the last day of the month, now you only need to count back one 'working day':

data toto;

lastDay=intnx('weekday',intnx('month',date(),0,'E'),-1);

format lastDay ddmmyy10.;

run;

Haikuo

View solution in original post


All Replies
Solution
‎07-31-2014 12:01 PM
Occasional Contributor
Posts: 17

Re: Getting the second to last working day

You already have the last day of the month, now you only need to count back one 'working day':

data toto;

lastDay=intnx('weekday',intnx('month',date(),0,'E'),-1);

format lastDay ddmmyy10.;

run;

Haikuo

Frequent Contributor
Posts: 75

Re: Getting the second to last working day

Posted in reply to haikuobian

Thank you so much Haikuo !!!

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 1288 views
  • 2 likes
  • 2 in conversation