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

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

1 ACCEPTED SOLUTION

Accepted Solutions
Peter_C
Rhodochrosite | Level 12

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.

View solution in original post

4 REPLIES 4
CTorres
Quartz | Level 8

1. Define the LIBNAME

2. Use PROC CONTENTS.

Reeza
Super User

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;

Astounding
PROC Star

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.

Peter_C
Rhodochrosite | Level 12

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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 4 replies
  • 2309 views
  • 3 likes
  • 5 in conversation