I have a few data sets in SAS which I am trying to collate into one larger set which I will be filtering later. They're all called something like table_201802
. My problem is that there are a few missing months (i.e. there exists table201802
and table201804
and up, but not table201803
.
I'm new enough to SAS, but what I've tried so far is to create a new data set called output testing
and ran a macro loop iterating over the names (they go from 201802
to 201903
, and they're monthly data so anything from 812 to 900 won't exist).
data output_testing;
set
%do i=802 %to 812;
LIBRARY.table_201&i
%end;
;
run;
%mend append;
I want the code to ignore missing tables and just look for ones that do exist and then append them to the new output_testing
table.