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
How do you delete duplicate observations in sas?
What are the ways in which macro variables can be created in sas programming?
name several ways to achieve efficiency in your program? : Sas programming
what are input dataset and output dataset options? : Sas programming
what is data governance? : Sas-di
Difference between sum function and using “+” operator?
Explain the main difference between the sas procedures and functions? : Sas-administrator
How do you test for missing values?
How to specify variables to be processed by the freq procedure?
This entry was posted in General. Bookmark the permalink. Post a comment or leave
how can you import .csv file in to sas? : Sas programming
what is business intelligence? : Sas-bi
which date functions advances a date time or date/time value by a given interval? : Sas programming
What is SAS informats?
what is the different between functions and procs that calculate the same simple descriptive statistics? : Sas programming