SAS Enterprise Guide

Desktop productivity for business analysts and programmers
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jimksas
Calcite | Level 5

Hello Friends -

can someone please help on my question?

is there any way we can perform "proc contents" for all SAS data sets into one particular folder where we have all SAS data sets RATHER than doing it individually?

i am talking about performing below code for all SAS data sets at same time.

proc contents data=jim.test;

run;

- Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Assign a library to the folder and then use Proc datasets.

You should also look into the SASHELP.VTABLE and SASHELP.VCOLUMN Tables. 

View solution in original post

5 REPLIES 5
Reeza
Super User

Assign a library to the folder and then use Proc datasets.

You should also look into the SASHELP.VTABLE and SASHELP.VCOLUMN Tables. 

jimksas
Calcite | Level 5

thanks Reeza. i found it.

/*i did*/

libname test 'f:\market\dvjkhasfljk\';

proc contents data=test. _all_;

run;

/*and it (html + sashelp.vtable + sashelp.vcolumn) has all the info. i need*/

Vince28_Statcan
Quartz | Level 8

proc contents is a hidden call to proc datasets with content statements. If you follow through the documentation of proc contents for DATA= option, you will find that

proc contents data=jim._ALL_;

run;

should achieve your desired result. The notice for the MEMTYPE= in the documentation only applies if you want proc contents for library members that are not datasets as those are the default member types output.

If you are looking only for a particular element of information from proc contents though, the SASHELP tables mentionned by Reeza are probably a better alternative if you have many, many datasets in your library.

jimksas
Calcite | Level 5

ops thanks 'Vince28' Smiley Happy...

kjohnsonm
Lapis Lazuli | Level 10

thanks for the post!

 

I like this as a basic template:

 

proc print data=SASHELP.VCOLUMN NOOBS;
VAR libname memname memtype name type length label format informat;
where label like "myField" AND LIBNAME='MyLibName_or_WORK' AND memname LIKE "%MyDataSetPattern%";
run;

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 3137 views
  • 4 likes
  • 4 in conversation