Hi All,
One of the library is used by lots of users and can get full quickly.
I would like to know if there is a code that gives how much is the space used and % of space remaining etc...
Your help would be much appreciated
Thank you
I do that outside of SAS, by using a script with df (the UNIX command that shows disk usage) through the CGI gateway, so a simple click on a web link is all that's needed.
But you can use such command from SAS (if XCMD is enabled, of course).
So we need to know
Hi Kurt,
Thank you for your response.
Please see below my answers :
I have run the proc options and I get the above ...so not sure how to proceed now.
Cheers
To my knowledge, SAS has no built-in tools to retrieve information like disk size and disk usage.
So you will either have to do it via shell script, or have XCMD enabled.
This is the code that gets all mounted volumes and their usage:
data df;
infile "df" pipe truncover firstobs=2;
input
volname :$50.
blocks
free
used_blocks percent7.
iused
ipercent percent7.
mountpoint :$50.
;
format used_blocks ipercent percent7.2;
run;
(used on AIX, Linux might need a slighly different column layout)
If you can't get XCMD enabled, you can use crontab to run the df regularly (every minute, if you want) and write the result to a file, which you then pick up with the same data step as above (just change the INFILE).
You then need to identify which mount points contain your SAS libraries.
Thank you Kurt,
yes I definitely need XCMD enabled as I get the below errror...so will speak to our SAS administrators etc and see if I am allowed to use this function ect...
ERROR: Insufficient authorization to access PIPE.
Cheers
As I said, you can run the command outside SAS and pick up the result. For this, you need to log on to the UNIX server with a SSH client (e.g. PuTTY). If you want to go down that route, let me know.
In particular would it be nice to know the exact UNIX brand you use (Linux, Solaris, AIX, HP-UX).
If you don;t have access ti PIPE (talk to the admins, there's seldom a good reason not to), you cannot retrieve free space information. You can still retrieve file information. Look a the very first (pinned) topic in the programming community. It should contain everything you need.
This kind of monotring is usually managed by platform administrators, and standard tool exists for this. So I sugets that you investigate those options first, before you are building something specific in SAS, or that is driven by the SAS platform.
SAS Environment Manager monitors your SAS server resources and can be configured to send alerts when disk usage is high - for example > 95%. See screenshot for an example:
The SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment.
SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.
Find more tutorials on the SAS Users YouTube channel.