How can I add macro to the below code to do the same thing for each month of the year separately? For example, I'd need to create sourceg.trades_nov2008 as well. Thank you.
data sourceg.trades_dec2008(drop=dt);
set sourceh.trades_: indsname=ds_name open=defer;
dt = input(scan(ds_name, 2, "_"), date9.);
day = day(dt);
month = month(dt);
year = year(dt);
newtime=time/1000;
format newtime time12.3;
Hour=hour(newtime);
Minute=minute(newtime);
Second=second(newtime);
run;