I have a question about the function of "_:"
data all_claims;
set dataset1
dataset2
dataset3_:;
I don't see a dataset entitled "dataset3_:" elsewhere in the code, though I do something close to it.
%macro dataset3 (year_start=, year=);
data dataset3&YEAR. (where=(mdy(12,31,&YEAR_START.)<svcdate<=mdy(12,31,&YEAR.)));
set have;
rename date1=date2;
run;
proc means data=dataset3&YEAR. noprint nway missing;
class var1 var2 var3;
var var5 var6;
output out=clean.dataset3_&YEAR. (drop=_:) sum=;
run;
%mend dataset3;
Any idea what dataset3_: is in reference to?
What's important here is the colon after dataset3_ - that means all data sets starting with the name "dataset3_" like so
data dataset3_2015;
set sashelp.class;
run;
data dataset3_2016;
set sashelp.class;
run;
data dataset3_2017;
set sashelp.class;
run;
data want;
set dataset3_:;
run;
What you end up with it all three data sets appended
What's important here is the colon after dataset3_ - that means all data sets starting with the name "dataset3_" like so
data dataset3_2015;
set sashelp.class;
run;
data dataset3_2016;
set sashelp.class;
run;
data dataset3_2017;
set sashelp.class;
run;
data want;
set dataset3_:;
run;
What you end up with it all three data sets appended
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.