Hi SAS Forum,
I wanted to get a list of the names of all SAS data files (no need variable list or file zise) in one of my folders. I have several hundred files there. Need to get a printout of the file names only
I did the following.
1. 1) I defined the libname.
libname abcd……………………;
2. 2) Gave this command
proc print data = sashelp.vtable (where = (libname="abcd")) noobs;
var memname nobs nvar;
run;
Q: It is taking ages. Is there any other alternative?
Thanks
Miris
LIBNAME URLIB "PATH TO YOUR FOLDER" ACCESS= READONLY ;
PROC DATASETS LIBRARY= URLIB ;
RUN;
QUIT;
This will list all SAS file types along with their sizes. Should a table have indexes the filesize for the indexes will also appear.
1. Define the LIBNAME
2. Use PROC CONTENTS.
If you take a quick look at the SASHELP.VTABLE you'll notice that all library names are stored as upper case, so I'd assume your query wouldn't return anything.
ods table Members=List_files;
proc datasets library=mis ;
run;quit;
If I'm not wrong ...
The "v" in "vtable" means "view". So every time you use it, it has to re-create the list of all data set information. You might find it faster to use PROC SQL and to extract comparable information from DICTIONARY.TABLES.
Good luck.
LIBNAME URLIB "PATH TO YOUR FOLDER" ACCESS= READONLY ;
PROC DATASETS LIBRARY= URLIB ;
RUN;
QUIT;
This will list all SAS file types along with their sizes. Should a table have indexes the filesize for the indexes will also appear.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.