Right now I'm connecting to the UNIX server and submitting the following commands
df -g /sasuser
df -g /saswork
df -g /sasuser/network_shared
It will give output as follows.
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/sasuserl 1419.00 503.79 65% 48937 1% /sasuser
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/sasworkl 477.00 206.59 57% 3283 1% /saswork
Filesystem GB blocks Free %Used Iused %Iused Mounted on
prod_storage:/SasShare 1638.40 451.07 73% 328973 2% /sasuser/network_shared.
I used to manually submit the df -g command in each directory as stated above twice (morning and evening) per day to monitor the space usage and then email the same to the team.
Appreciate if someone help me with the SAS program to accomplish this task. Thank you!
Mainline per librray, eg sasuser:
data _null_;
call system("df -g /sasuser > /home/sasuser_usage.txt");
/* add similar to create any other library result */
run;
filename mymail email "..send_to@..." ;
data _NULL_;
file mymail;
to = ("email_address1@..." "email_address2@..." ... etc... )
/* optional */ cc= ("...email ..." ....)
subject = "... subhect text ..."
attach = ("/home/sasuser_usage.txt" "...2nd file..." ...etc... );
put "... text line 1 ...";
put "... text line 2 ...";
...etc.....
run;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.