Hi Klaz,
Thank you very much for you help on this one. The code worked wonders.
Just a few things I changed in the code you have provided is that I have removed . from .&mon3 as it was giving syntax errors and also we need not give the libref's in the macro initialization...
The following program works for a single month.
data libname.outputdata;
set libname.inputdata (keep=tdate);
if month(tdate) in (01,02,03,04,05,06,07,08,09,10,11,12) then all_mon_trans=1;
else no_trans=1;
select(MONTH(tdate));
when(01)
current_mon_trans=1;
when(12)...
You can use proc summary which displays all the summary statistics by default including the quartiles but this may be too much of output to look at. To avoid this, you can use proc univariate in which you can request specific statistics like Q1 and Q3 so that you get to see only what you want.
Isn't the run statement optional as the data step is followed by a proc step. Even if I add the run statement its not working as the error is showing near the MONTH() function.
Hello there,
I have been trying to use the sas inbuilt function MONTH to extract the month of a particular transaction date. And I need to write same set of steps for all the 12 months and therefore tried using macro. I am not sure how SAS recognizes functions within a macro. I have...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.