BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
cdubs
Quartz | Level 8

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? 

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisBrooks
Ammonite | Level 13

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

View solution in original post

1 REPLY 1
ChrisBrooks
Ammonite | Level 13

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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1542 views
  • 0 likes
  • 2 in conversation