BookmarkSubscribeRSS Feed
greg6363
Obsidian | Level 7
I was able to get access to a database but it contains 276 separate tables. In order to see what variables are in each table, I can use PROC CONTENTS to get a list of said variables but it’s too laborious to write a PROC CONTENTS statement for each table. Is it possible to create a macro with a macro variable called TABLE in order to call the name of each individual table from a list? Any assistance is appreciated. Thanks.
4 REPLIES 4
PaigeMiller
Diamond | Level 26

No macros needed.

 

Issue the proper LIBNAME statement to connect to this database. Then find the view named SASHELP.VCOLUMN and look at that. All the information about the variables and the tables in this database is in there.

--
Paige Miller
SASKiwi
PROC Star

What is your objective? To write queries of these tables or something else? What database are you accessing?

Astounding
PROC Star
PROC CONTENTS contains a shortcut for doing exactly what you want:

proc contents data=libname._all_ ;
run;
greg6363
Obsidian | Level 7
I thought you could only use the _all_ in a PUT statement. Let me give it a try. Thanks.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 4 replies
  • 510 views
  • 4 likes
  • 4 in conversation