I have a bunch of datasets named after dates (for example, 20130102) in a library called taq. Normally when I tried to read in multiple datasets I would do set taq.cq_&yyyymmdd:;. So that if I input yyyymmdd as 201201, it will fetch all the datasets starting with the prefix 201201.
However, now I am trying to run a macro looping across all datasets. Ideally:
%MACRO EXAMPLE(DATE_VAR);
DO WHILE(...);
%ANOTHER_MACRO(SOMETHING);
END;
%MEND;
If I input %EXAMPLE(201301); , it will call another macro which executes on every dataset starting with the prefix 201301.
I was wondering how to design a do loop to do that?
I have read some posts on SAS forum and StackOverflow. But it seems that they either run the macro on all of the datasets, or they require a manual input of a list of datasets that I am running on. I am trying to make the procedure automatic (that is, the program can detect all the datasets with a prefix itself.)