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


Please Help Members By Posting Answers For Below Questions

What do you know about sas data set?

587


what is the difference between: x=a+b+c+d; and x=sum (of a, b, c ,d);? : Sas programming

599


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?

1764


how many types prompting framework can be broken down to? : Sas-bi

619


what is hash files in sas and why we are using this one in sas?

1718






hi tell be about pfizer? how to compare the work with other companies ? please tell me how to login and work also?

1656


what is ae onset date n what is RDS

1931


Name validation tools used in SAS

683


what is study design in while working with SAS? what are screening variables in SAS?

1675


what are the softwares and applications that are used most frequently used by sas bi applications developers? : Sas-bi

544


What is PDV?

717


Why and when do you use proc sql?

751


Which are the statements whose placement in the data step is critical?

754


how many types of prompts are there? : Sas-bi

543


What is the purpose of trailing @ and @@? How do you use them?

605