Hi all,
I just want to ask a quick question. I have 500 datasets and I want to run the same code for all datasets. The name of my datasets are TV1, TV2, .... TV500. I think I need to use MACRO statements here. So, firstly I write the code for just one dataset:
data KHA. TV1A;
set KHA. TV1;
by datetime;
if first.datetime then V = 0;
V+volume;
if last.datetime then output;
run;
Then I test the following code (I got it from your communities, as well), however I cannot get results:
%MACRO repeat(dslist=);
%DO i=1 %TO %SYSFUNC(COUNTW(&dslist));
%LET ds = %SCAN(&dslist, &i);
DATA &ds;
SET &ds;
by datetime;
if first.datetime then V = 0;
V+volume;
if last.datetime then output;
END;
RUN;
%END;
%MEND repeat;
%repeat(dslist= TV1, TV2, .... TV500);
Could you please help me about that? Could you please give me any other ways to run the same code for multiple assets?
... View more