One of our users is looking to obtain the actual windows physical size of a SAS Data Set within Enterprise Guide - just wondering does anybody know a quick way of surfacing the file size up via Enterprise Guide?
We can provide this info by logging onto the server and using right click properties on the file in question via Windows. And we also have a piece of SAS code that will produce a report of physical table size in the library location. But both of these options are not a quick, click and view option for the user.
Thanks,
Tom
Does this help? This lists the file sizes for all data sets in SASHELP library.
proc sql;
select memname, filesize format=sizekmg10.1
from dictionary.tables
where libname='SASHELP' and memtype='DATA';
quit;
You can also use the Tasks->Data->Data Set Attributes task, which includes a File Size field in its report.
If you have already a piece of SAS code why can't the user run this code as well? You could implement it as an autocall macro so the end user would only need to call the macro passing in the path/filename. Is options XCMD set?
Oh, and if this is about SAS tables then you would want to create some SAS code which also lists the related indexes and the like.
Hello Partick,
Thank you for your response.
The SAS code uses the XCMD PIPE option which is unavailable to users for security reasons, we have to run the code directly on our SAS servers to get a successful output in the report.
I will take a look at the autocall macro's to see if we can provide a solution using those.
Thanks,
Tom
Another option if you have a Windows SAS server is to provide a Windows share like: \\SASServer\FolderShare.
Then uses can navigate to the share in Windows Explorer on their PC and look at file properties.
That means you have NOXCMD set. That will make it very hard for users to retrieve file size information via SAS programs (autocall macro won't help).
You could try to implement this as a stored process which the user can call - the stored process would then need under a user/in an environment with XCMD set.
As for "NOXCMD for security reasons": Chris Hemedinger wrote a very good blog about this:
Hi Tom,
If you're not able to access the XCMD I'm fairly sure you can use the VEXTFL (or DICTIONARY.EXTFILES if accessing via PROC SQL) dictionary table to achieve this, e.g.;
filename myfile 'C:\<path-to>\<my-file>.sas7bdat';
data _null_;
set sashelp.vextfl(where=(fileref='MYFILE'));
/* Calculate size in MB */
filesize=filesize/(1024**2);
call symputx('filesize',filesize);
run;
Does this help? This lists the file sizes for all data sets in SASHELP library.
proc sql;
select memname, filesize format=sizekmg10.1
from dictionary.tables
where libname='SASHELP' and memtype='DATA';
quit;
You can also use the Tasks->Data->Data Set Attributes task, which includes a File Size field in its report.
I didn't know about that dictionnary library, I guess it use sashelp.vtable, but vtable seems to contain only user define library. Good to know about the dictonnay library.
Thanks, I'm always on the look out for those little things.
No. I don't think so. It is depended on different engine.
If engine is SPDS , you can't get that on account of a table is split into a several sub-table stored in different fold .
If it was SPDS , there is a command SPDSLS you can use to get the library’s size . Or use my code via UNIX command .
Hi Chris, is there any possibility to add the functionality/feature of viewing data size all tables/datasets under each library in the next release of Enterprise guide explorer? I can see this functionality for folders that are under 'Home' but not under libraries. It would be better for sas users if this feature is available.
Thank you
Sowmya Mallela
Hi Sowmya,
We don't know exactly what the user experience will be yet, but yes, we are planning on making it easier to get the file size (and any other properties that you can find in the server's dictionary tables) from within the EG UI in a future release.
Casey
Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF
View now: on-demand content for SAS users
Another option is to use the "External Files" routines to pull out the file size. I don't have access to a server environment to test it, but I believe it would work fine, and it doesn't involve the X command capability.
Tom
My question would be what is the logical reason for that question. Dataset physical sizes will get a different meaning in some time. You can have index/auditfiles (adding more needed space) and having compression. It makes the once hard lined information become soft and less predictable. When it is about managing the space and predicting the future needs than that is the question to solve.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.