Dear Friends, I am using the following code to find the beginning week day of every month, I am taking the latest daily data available in our database which is from June 2016. %do i=0 %to 2; first_day_&i = intnx('weekday',intnx('month',day,-&i,'b'),0); format first_day_&i yymmdd10.; if date = first_day_&i then output; %end; So, now I need values from APR2016 to JUN2016 (3 month values, code has to be automated to run to pick latest 3 months for current data) , so, 1st working day of June which is 01JUNE2016 and SAS could able to recognise and giving correct output, also for April 01APR2016 is weekday and its picking correctly. But for May2016, 1st is sunday and 2nd, Monday is a public holiday, so the date in database starts from 03May2016, SAS instead to take 03MAY2016, it is considering 29APR2016, which is Friday of previous month, Why it is checking in previous month? Please advise and guide me on this issue. I need 03May2016 value as the output.
... View more