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 do you know about sas data set?
what is the difference between: x=a+b+c+d; and x=sum (of a, b, c ,d);? : Sas programming
Is the physical structure of the data set in the same orientation as the report? Do you need to reshape the data sets? What method should you use to reshape the data–DATA steps,PROC TRANSPOSE,output data set from a procedure?
how many types prompting framework can be broken down to? : Sas-bi
what is hash files in sas and why we are using this one in sas?
hi tell be about pfizer? how to compare the work with other companies ? please tell me how to login and work also?
what is ae onset date n what is RDS
Name validation tools used in SAS
what is study design in while working with SAS? what are screening variables in SAS?
what are the softwares and applications that are used most frequently used by sas bi applications developers? : Sas-bi
What is PDV?
Why and when do you use proc sql?
Which are the statements whose placement in the data step is critical?
how many types of prompts are there? : Sas-bi
What is the purpose of trailing @ and @@? How do you use them?