BookmarkSubscribeRSS Feed
Thalitacosta
Obsidian | Level 7

I have the following outputs data:

resul_201901

resul_201903

resul_201906

resul_201909

resul_201912

resul_202001

resul_202106

resul_202203

How to join all of them, since the way I'm doing it doesn't work:

 

data Resul_end;

set resul_201901-resul_202203;

run;

 

Is there a way to do without quoting all?

3 REPLIES 3
PeterClemmensen
Tourmaline | Level 20

This does not join the tables. It merely stacks them. 

 

Please provide sample data in usable form if you want a usable code answer 🙂

PGStats
Opal | Level 21

Build the list with SQL from the DICTIONARY.TABLES dataset:

 

proc sql noprint;
select memname into :sets separated by " "
from dictionary.tables 
where libname="WORK" and memname like "RESUL_20%"
order by memname;
quit;

data Resul_end;
set &sets.;
run;
PG
ballardw
Super User

If those are ALL the Resul_ files in the library:

The : at the end of a base name will build a list of all names that start with those characters

 

 

data want;
   set resul_:  ;
run;

If you have more apparent years and want ALL the sets from 2019, 2020, 2021 and 2022

 

 

data want;
   set resul_2019:  resul_2020: resul_2021:  resul_2022:  ;
run;

 

 

but if you want a random selection not likely to be much of a short cut list possible.

Note Resul_20:  would reference all datasets with a year starting with 20 but can't tell if that is helpful.

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 3 replies
  • 565 views
  • 3 likes
  • 4 in conversation