BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
zimcom
Pyrite | Level 9

Hi Community,

 

I received 30 plus SAS datasets and want to quickly retrieve all the variable names of each datasets 

 

Is there a quick way to do this? 

 

Thanks as always

1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star

This will give you a little more than what you are requesting, but you will probably find it all useful:

 

libname me 'path to folder holding your SAS data sets';

proc contents data=me._all_;
run;

View solution in original post

5 REPLIES 5
Reeza
Super User
Sure, create a libname to the folder and use SASHELP.VCOLUMN with the lists of all variables.
zimcom
Pyrite | Level 9

SASHELP.VCOLUMN

 

how?

 

I am using SAS 9.4

Thanks

Reeza
Super User
proc sql;
create table want as
select *
from sashelp.vcolumn 
where libname = "LIBNAME";
quit;

I'm assuming you do know how to create a library references. Replace the libname in quotes with the libname you use in upper case and that should work. SASHELP is a default library available and you can navigate to the data sets to see what they contain.

 


@zimcom wrote:

SASHELP.VCOLUMN

 

how?

 

I am using SAS 9.4

Thanks


 

Astounding
PROC Star

This will give you a little more than what you are requesting, but you will probably find it all useful:

 

libname me 'path to folder holding your SAS data sets';

proc contents data=me._all_;
run;
zimcom
Pyrite | Level 9

@Astounding @Reeza 

 

 

THANK YOU BOTH, HAVE A GREAT WEEKEND!!

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 4102 views
  • 3 likes
  • 3 in conversation