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
SAS Super FREQ
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.

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!

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