How to find out no. of business days in a month using
macros.???(excluding weekends and holidays).
Answers were Sorted based on User's Feedback
Answer / aaa
%MACRO WORKDAYS(START,END);
DATA _NULL_;
FORMAT A B DDMMYY10.;
A = %SYSFUNC(INPUTN(&START,DDMMYY10.));
B = %SYSFUNC(INPUTN(&END,DDMMYY10.));
COUNT=0;
DO I = A TO B;
IF WEEKDAY(I) IN (2,3,4,5,6) THEN
COUNT=COUNT+1;
END;
PUT 'NUMBER OF WORKING DAYS BETWEEN ' A 'AND ' B '= ' COUNT;
RUN;
%MEND;
%WORKDAYS(01/10/2014,31/10/2014);
| Is This Answer Correct ? | 7 Yes | 0 No |
Answer / oanhntt
first of all, identify the last day of month (using this
intnx('month',d,1)-1). after that make a loop through 1 to
end of month, check if day in loop is weekend or not, using
another variable to count this number.
Regarding to the holidays, except some popular holidays which
I suggest using an external file/dataset to track it, use
this file to identify holidays.
| Is This Answer Correct ? | 1 Yes | 3 No |
How do you add a number to a macro variable? : sas-macro
What is criteria for adverse events and treatment-emergent adverse events?
Where do the database management systems store data and how do u import them.
what are sas/access and sas/connect? : Sas programming
How do you control the number of observations and/or variables read or written? Approximately what date is represented by the SAS date value of 730?
Please write codes to merge two datasets and keep every record in the first dataset.
. Which date advances a date, time or date/time value by a given interval?
what are scrubing procedures in SAS?
hi all, I need the SAS DI DUMP(A00 260) for attending the certification. if any one have, pls provide it.Please Email to vrpotluri@hotmail.com. Thanks - Ramana
Which is the Best SAS training Institute in Delhi NCR for SAS certification preparation
How to get top scorer student from a class-table having different sections A,B, C & D? Each section having same number of students.
How do you write a test plan?