03-23-2015 07:02 AM
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.
03-23-2015 07:22 AM
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.
03-23-2015 07:53 AM
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.
03-23-2015 02:47 PM
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.
03-23-2015 05:55 PM
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:
03-23-2015 06:21 PM
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';
/* Calculate size in MB */
03-24-2015 07:35 AM
Does this help?
select memname, filesize format=sizekmg10.1
where libname='SASHELP' and memtype='DATA';
03-24-2015 08:45 AM
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.
03-24-2015 09:14 AM
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 .
03-26-2015 01:18 PM
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.
04-02-2015 05:27 AM
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.