BookmarkSubscribeRSS Feed
omega1983
Calcite | Level 5
In a sas library named claims I have the following:

claims.inv06_2010_1;
claims.inv06_2010_2;
claims.inv06_2010_3;
claims.inv06_2010_4;
......and so on up to about 100

I would normally have something like
data INV;
set claims.inv06_2010_1;
claims.inv06_2010_2;
claims.inv06_2010_3;
claims.inv06_2010_4;
run;

Is there a way to have a macro identify all of those claims.inv06_2010 tables without having to type out all of the tables individually. I have on average about 100 tables. This example is just for 1 year.
5 REPLIES 5
RickM
Fluorite | Level 6
Try using the sashelp.vcolumn table and proc sql to select the table names into a macro variable.

Good luck!
Cynthia_sas
Diamond | Level 26
You don't actually need a macro program. As long as the names -start- with the same prefix, you can use the colon in a name list, as shown here:
http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a003040446.htm

See the section entitled, "Data Set Lists" which has an example of how to use the colon to refer to a data set list.

cynthia
RickM
Fluorite | Level 6
True, but if you are stuck with SAS 9.1 you don't have that nice little feature.

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
  • 5 replies
  • 1706 views
  • 0 likes
  • 3 in conversation