BookmarkSubscribeRSS Feed
vickys
Obsidian | Level 7

HI Experts,

 

we in the process of migration and I came across a situation where I need to Find all the Datasets in particular Folder in SAS DI and their Size as well.

 

I have generated a report in SAS DI but its giving all the information on jobs , Tables, and columns etc.

 

I am looking for the datasets present in particular folder, Dataset path and Datasets Size.

 

Could someone please share some info if they have idea.

 

Really appreciate it.

 

Thanks,

Vicks

1 REPLY 1
AllanBowe
Barite | Level 11

When you say folder, I'm presuming you mean a physical directory (not metadata folder).

 

The following macro will give you what you need: https://core.sasjs.io/mp__dirlist_8sas.html

 

Use the `getattrs` parameter to get additional (size) info, eg as follows:

 

%mp_dirlist(path=/your/folder,outds=work.results,getattrs=YES)

If you're looking to simply grab the size of a single dataset you can also use this macro function: https://core.sasjs.io/mf__getfilesize_8sas.html

 

/Allan
MacroCore library for app developers
Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs

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

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 851 views
  • 0 likes
  • 2 in conversation