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!!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

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
  • 2395 views
  • 3 likes
  • 3 in conversation