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;

 

    

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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