12-10-2012 07:34 PM
That is what I want to know on a Windows server hosting SAS. I haven't been granted remote access to server's desktop, only have SAS admin right. So I can see certain folders and files using MC, but I want to know how much available space left without involving Windows team every time.
12-11-2012 12:59 AM
If you have read access to the user directories you can write a Unix script to list recursively file names and sizes to a text file, then use SAS to launch the script via the X command and read in the data in a SAS data step. It's a bit tedious because you have to separate out header records for each directory (and possibly retain the directory name). I don't have an example. You can also use Unix df and du (disk free and disk used) to see whether there is a problem looming.
There are SAS functions which can be used to interrogate the file system, which might be an alternate route.
The same approach will work on Windows, provided that you have at least read access to the folders. I cannot see any way to monitor if you do not have such access. I do not know whether there is a Windows equivalent to df, which might be all you need if it is available
12-11-2012 10:33 AM
I was hoping for something using dictionary tables and SAS alone.
From those I can see file size though I know it's not 100% correct, but I dont' know how to get the user/owner. If I right click on the library and check the properties I can see the owner, but looking for a way to do that via programming.
12-12-2012 12:56 AM
Since you asked, you can create a list of file names and the directories they are in using the dictionary tables. This list can then be processed using SAS external file functions iteratively. For each file, use the following
Do until done