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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

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
  • 4 replies
  • 1121 views
  • 3 likes
  • 5 in conversation