Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



How to find out no. of business days in a month using macros.???(excluding weekends and holidays)...

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

How to find out no. of business days in a month using macros.???(excluding weekends and holidays)...

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

Post New Answer

More SAS Interview Questions

Does anybody have SAS Training manual or documentation or can you refer me any book to have better understanding on SAS. I am fresher to SAS tool. (Ready to pay)

4 Answers  


How substr function works in sas?

0 Answers  


what is the difference between floor and ceil functions in sas? : Sas-administrator

0 Answers  


How would you generate 1000 observations from a normal distribution with a mean of 50 and standard deviation of 20. How would you use PROC CHART to look at the distribution? Describe the shape of the distribution.

1 Answers  


What are some problems you might encounter in processing missing values? In Data steps? Arithmetic? Comparisons? Functions? Classifying data?

1 Answers   Quintiles,


What is proc sql pass through facility?

4 Answers   L&T,


Could you please answers for this. 1.Code the tables statement for a single-level (most common) frequency. 2.Code the tables statement to produce a multi-level frequency.

2 Answers  


Tell me about % include and % eval? : sas-macro

0 Answers  


if the Id has more then two transcatiion then show the first observation, IF Id has only two observation then It show both the observation

0 Answers   CTS,


In which format does Date stores in sas..? What is the use of DATE in SAS.?

3 Answers   TCS,


how do we mail reports from SAS environment to our team leader

5 Answers   Wockhardt,


what is the diff b/w verification validation in sas

3 Answers   SAS,


Categories