<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Need to Send email notification when the disk is 75% full, we are using Unix in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-to-Send-email-notification-when-the-disk-is-75-full-we-are/m-p/241800#M44830</link>
    <description>&lt;P&gt;Assume /tmp exceeds 75%, &amp;nbsp;then how will you pipe this details into macro variable?&lt;/P&gt;</description>
    <pubDate>Tue, 05 Jan 2016 09:21:51 GMT</pubDate>
    <dc:creator>Babloo</dc:creator>
    <dc:date>2016-01-05T09:21:51Z</dc:date>
    <item>
      <title>Need to Send email notification when the disk is 75% full, we are using Unix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-Send-email-notification-when-the-disk-is-75-full-we-are/m-p/241785#M44826</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to Write a SAS code which would trigger an email when the disk size reaches 75%.&lt;/P&gt;&lt;P&gt;Kindly help me on this.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2016 05:54:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-Send-email-notification-when-the-disk-is-75-full-we-are/m-p/241785#M44826</guid>
      <dc:creator>santosh_pat69</dc:creator>
      <dc:date>2016-01-05T05:54:21Z</dc:date>
    </item>
    <item>
      <title>Re: Need to Send email notification when the disk is 75% full, we are using Unix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-Send-email-notification-when-the-disk-is-75-full-we-are/m-p/241790#M44829</link>
      <description>&lt;P class="cs95e872d0"&gt;Hi,&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;You can use following logic:-&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;By using X command please fire "DF" command on Linux. It will give you details of all drives available on Linux. Pipe these details into a macro variable for your desired drive. If that macro variable is having value more than 75% fire following data step:-&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&lt;SPAN class="csa16174ba"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp; filename outbox email "&amp;lt;Email id to whom email is send&amp;gt;"; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&lt;SPAN class="csa16174ba"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp; data _null_; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&lt;SPAN class="csa16174ba"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;file outbox&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&lt;SPAN class="csa16174ba"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;subject="Alert!!!!!! &amp;nbsp;Disk space is 75% occupied" &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&lt;SPAN class="csa16174ba"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp; &amp;nbsp; ; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&lt;SPAN class="csa16174ba"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp; &amp;nbsp; put 'Your hard disk is 75% occupied. Please clean unused data.'; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&lt;SPAN class="csa16174ba"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&lt;SPAN class="csa16174ba"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;In short over all logic will be:-&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&lt;SPAN class="csa16174ba"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;%macro check_hard_disk_capacity;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&lt;SPAN class="csa16174ba"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;/*X command to check desired hard disk capacity and take it into macro variable*/&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&lt;SPAN class="csa16174ba"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;%if &amp;amp;macro_varaible &amp;gt; 75 %then %do;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&lt;SPAN class="csa16174ba"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;filename outbox email "&amp;lt;Email id to whom email is send&amp;gt;";&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&lt;SPAN class="csa16174ba"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp; data _null_; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&lt;SPAN class="csa16174ba"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;file outbox&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&lt;SPAN class="csa16174ba"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;subject="Alert!!!!!! &amp;nbsp;Disk space is 75% occupied" &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&lt;SPAN class="csa16174ba"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp; &amp;nbsp; ; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&lt;SPAN class="csa16174ba"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp; &amp;nbsp; put 'Your hard disk is 75% occupied. Please clean unused data.'; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&lt;SPAN class="csa16174ba"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&lt;SPAN class="csa16174ba"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;%end;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&lt;SPAN class="csa16174ba"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;%mend;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&lt;SPAN class="csa16174ba"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;I hope this helps.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&lt;SPAN class="csa16174ba"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Regards,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="cs95e872d0"&gt;&lt;SPAN class="csa16174ba"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Abd.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2016 07:10:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-Send-email-notification-when-the-disk-is-75-full-we-are/m-p/241790#M44829</guid>
      <dc:creator>ad123123</dc:creator>
      <dc:date>2016-01-05T07:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: Need to Send email notification when the disk is 75% full, we are using Unix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-Send-email-notification-when-the-disk-is-75-full-we-are/m-p/241800#M44830</link>
      <description>&lt;P&gt;Assume /tmp exceeds 75%, &amp;nbsp;then how will you pipe this details into macro variable?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2016 09:21:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-Send-email-notification-when-the-disk-is-75-full-we-are/m-p/241800#M44830</guid>
      <dc:creator>Babloo</dc:creator>
      <dc:date>2016-01-05T09:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: Need to Send email notification when the disk is 75% full, we are using Unix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-Send-email-notification-when-the-disk-is-75-full-we-are/m-p/241808#M44833</link>
      <description>&lt;P&gt;Speak to your IT group, they will have tools which can monitor drive space on a network and alert users when a drive is filling up. &amp;nbsp;Don't try to re-invent the wheel on your own.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2016 09:49:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-Send-email-notification-when-the-disk-is-75-full-we-are/m-p/241808#M44833</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-01-05T09:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: Need to Send email notification when the disk is 75% full, we are using Unix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-Send-email-notification-when-the-disk-is-75-full-we-are/m-p/242165#M44940</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro send_email;

	data _null_;
	&amp;lt;X command to get values of disk space. Let us assume that this output is redirected to
	file "out.txt." stored at "&amp;lt;Your location&amp;gt;";
	run;

	data input_data;
		infile "&amp;lt;Your file location&amp;gt;"
			firstobs = 1
			dlm = ":"
			missover
			dsd
			lrecl = 32767;
		input
			Description : $char128. /*string field of 128 chars long*/
		bytes_Occupied : $char128. /*numbers of all types ints, floats, etc */
		;
	run;


	data input_data;
		set input_data;
		Description=tranwrd(compress(Description,''),'#','no');
	run;

	proc sql;
		select bytes_occupied into : free_bytes from input_data where description='Totalnooffreebytes';
		select bytes_occupied into : total_bytes from input_data where description='Totalnoofbytes';
		create table memory_stat 
			(
			Total_no_of_free_bytes char(10000),
			Total_no_of_bytes char(10000)
			);
		insert into memory_stat values("&amp;amp;free_bytes.","&amp;amp;total_bytes.");
	quit;

	data memory_stat(drop=Total_no_of_free_bytes Total_no_of_bytes);
		set memory_stat;
		Total_no_of_free_bytes_num=input(Total_no_of_free_bytes,20.0);
		Total_no_of_bytes_num=input(Total_no_of_bytes,20.0);
		Disk_consumption_in_perctage=(Total_no_of_bytes-Total_no_of_free_bytes)/Total_no_of_bytes*100;
		call symputx("disk_utilization",Disk_consumption_in_perctage);
	run;

	%put &amp;amp;disk_utilization.;

	%if &amp;amp;disk_utilization. &amp;gt;= 75 %then
		%do;
			filename outbox email "&amp;lt;Email id&amp;gt;";

			data _null_;
				file outbox
				subject="Alert!!!!!!  Disk space is 75% occupied"    
				;
				put 'Your hard disk is 75% occupied. Please clean unused data.';
			run;

		%end;
%mend;
%send_email;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Not sure about Unix commnd but using windows command which is giving output as per attached snapshot we can code a mcaro mentioned above. Some calculations has to be done to get a macro parameter.I hope this will help.&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/12172i43D525220A143A79/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="Log_File_Windows_Disk_Consumption.JPG" title="Log_File_Windows_Disk_Consumption.JPG" /&gt;</description>
      <pubDate>Thu, 07 Jan 2016 06:23:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-Send-email-notification-when-the-disk-is-75-full-we-are/m-p/242165#M44940</guid>
      <dc:creator>ad123123</dc:creator>
      <dc:date>2016-01-07T06:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: Need to Send email notification when the disk is 75% full, we are using Unix</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-Send-email-notification-when-the-disk-is-75-full-we-are/m-p/242291#M44969</link>
      <description>&lt;P&gt;If you have a SAS 9.4 platform installation then you may&amp;nbsp;have SAS Environment Manager which can be configured to montitor resources such as disk space utilization, and generate alerts with an escalation scheme. Some resources that may be of interest to you if you want to use this approach:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings13/463-2013.pdf" target="_self"&gt;SAS Global Forum Paper 463-2013:&amp;nbsp;Monitoring 101: New Features in SAS 9.4 for Monitoring Your SAS&amp;nbsp;Intelligence Platform&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.sas.com/content/sgf/2015/08/19/monitor-your-saswork-directory-from-sas-environment-manager/" target="_self"&gt;SAS Blog Post: Monitor your SASWORK directory from SAS Environment Manager&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/evug/68091/HTML/default/viewer.htm" target="_self"&gt;SAS Environment Manager 2.5: User's Guide&lt;/A&gt; including &lt;A href="http://support.sas.com/documentation/cdl/en/evug/68091/HTML/default/viewer.htm#p1u6rpfcxhmfxvn1ay6n0ybxr9xu.htm" target="_self"&gt;Example: Defining an Alert for SAS Work Directory Space&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2016 23:01:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-Send-email-notification-when-the-disk-is-75-full-we-are/m-p/242291#M44969</guid>
      <dc:creator>PaulHomes</dc:creator>
      <dc:date>2016-01-07T23:01:37Z</dc:date>
    </item>
  </channel>
</rss>

