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

sas-innovate-2024.png

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.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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