BookmarkSubscribeRSS Feed
Babloo
Rhodochrosite | Level 12

 

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!

1 REPLY 1
Shmuel
Garnet | Level 18

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;

 

    

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1669 views
  • 0 likes
  • 2 in conversation