How to find out no. of business days in a month using
macros.???(excluding weekends and holidays).
Answer Posted / 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 |
Post New Answer View All Answers
What are the functions used for character handling?
what is snowflake schema? : Sas-di
Differences between where and if statement?
name several ways to achieve efficiency in your program? : Sas programming
I am preparing SAS Certified Advanced Programmer for SAS 9 in 2014. If anybody has the latest dumps for this exam, please mail me at dhiman.mukherjee@gmail.com
what are several options for creating reports in web report studio? : Sas-bi
What is the difference between input and infile statement?
What would be the result of the following SAS function (given that 31 Dec, 2000 is Sunday)?
what are some good sas programming practices for processing very large data sets? : Sas programming
how does sas handle missing values in: assignment statements, functions, a merge, an update, sort order, formats, procs? : Sas programming
How you can read the variables that you need?
which features do you use to check the data validations and errors? : Sas-administrator
What is the difference between class statement and by statement in proc means?
What is the difference between match merge and one to one merge?
how do the in= variables improve the capability of a merge? : Sas programming