<?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: Email from EG when bandwidth exceeded in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Email-from-EG-when-bandwidth-exceeded/m-p/747350#M38928</link>
    <description>&lt;P&gt;First of all, I think email is fine to use. Everyone likes their own means of communication and email works well. So does SMS and other means. Email/SMS show up while you are anywhere which is nice.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That out of the way, when I send email I use a service. Our solution involves our own services but it is easy to use SMS or email services (ex. MailChimp using proc http. Look here:&amp;nbsp;&lt;A href="http://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n197g47i7j66x9n15xi0gaha8ov6.htm" target="_blank"&gt;SAS Help Center: Syntax: PROC HTTP PROC HTTP Statement&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You will probably be using a POST command so follow that.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, there are other services other than MailChimp. Pick whichever one works for you and do a&amp;nbsp; REST call. REST makes everything easy w/o having to reinvent the world. There will also be REST calls for SMS.&lt;/P&gt;</description>
    <pubDate>Fri, 11 Jun 2021 14:18:30 GMT</pubDate>
    <dc:creator>AlanC</dc:creator>
    <dc:date>2021-06-11T14:18:30Z</dc:date>
    <item>
      <title>Email from EG when bandwidth exceeded</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Email-from-EG-when-bandwidth-exceeded/m-p/747217#M38919</link>
      <description>Hi all,&lt;BR /&gt;Hope I can describe my idea in a clear way...&lt;BR /&gt;So today I was thinking I might convince EG to send me an email, if in a certain column usually I see values like seven, eight or perhaps every once in a while six or seldom a nine; and suddenly I would be seeing 40 or 100 or 0 ... that would be weird; it'd be something worth looking into; so the bandwidth in which I expect my stuff to be sort of gets 'exceeded' . So then I want to be mailed about that.&lt;BR /&gt;&lt;BR /&gt;Now I know how to configure the email part, given I would still need to somehow obtain emailserverdetails etc. - but I need help to specify exactly when I want to be mailed.&lt;BR /&gt;&lt;BR /&gt;I suppose I need an EG process flow? Is that correct?&lt;BR /&gt;&lt;BR /&gt;Some data set import is probably step a ; and then an E-mail sending step is step c .&lt;BR /&gt;But what do I put in between as step b... ?&lt;BR /&gt;&lt;BR /&gt;Like &amp;lt;10 or so, but I would want it to not refer to absolute values... In the sense that it could work, but would be better if it looked at what average values usually come through or so... then determine deviation from the means...?&lt;BR /&gt;Just thinking out loud now, I am no statistician &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;Can anyone help on part b please or is my trail of thought faulty... or perhaps, is EG not the right tooling for this idea,... or is the idea not feasible or are there dependances ?</description>
      <pubDate>Thu, 10 Jun 2021 21:00:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Email-from-EG-when-bandwidth-exceeded/m-p/747217#M38919</guid>
      <dc:creator>heleenw</dc:creator>
      <dc:date>2021-06-10T21:00:43Z</dc:date>
    </item>
    <item>
      <title>Re: Email from EG when bandwidth exceeded</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Email-from-EG-when-bandwidth-exceeded/m-p/747224#M38920</link>
      <description>&lt;P&gt;If you don't want to report with hard coded values then you will need to do something to establish boundaries for when to report.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are worried about extremes that occur intermittently you might look at the RANGE statistic for a time period. That is basically the largest value minus the smallest. So if the range is "large" you might have an extreme.&lt;/P&gt;
&lt;P&gt;Another thing to look at might be Standard deviation but it is not as sensitive to one or two values if you have 1000s. But a single value 2 or 3 standard deviations from the mean might be an outlier.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might do some investigation on a "large" set of data (several months perhaps) just to learn about the distributions of your data values to determine some likely basic rules and provide parameters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc Means asking for mean, min, max, std, mode, median and maybe the Q1 and Q3 quantiles should show you a bit about your current data&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you have some sort of change seasonally like temperature going down in winter and increasing in summer? If so you should create the summaries by groups that might reflect that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What goes into your data makes a difference on what may be useful to look at. I worked with a lot of instrument data related to weather and soil conditions once upon a time to help diagnose possible instrument issues. So I had seasonality to set some bounds for "reasonable" values; some instruments had natural ranges such as humidity (really cannot go below 0 or over 100 but some conditions would make the instruments report that), or barometric pressure (0 would mean there is no local atmosphere). Others I looked at rates of change (air temperature is unlikely to go from 10 to 100 degrees in one hour).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The idea of what to check will tell you how to make the report. Generally a set of values, which would be&amp;nbsp; in a data set, and rules on how to compare those values to your data flow.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to report? Provide some actual rules you come up with after looking at your data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 21:49:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Email-from-EG-when-bandwidth-exceeded/m-p/747224#M38920</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-06-10T21:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: Email from EG when bandwidth exceeded</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Email-from-EG-when-bandwidth-exceeded/m-p/747226#M38921</link>
      <description>&lt;P&gt;Well, you would need to define what trigger levels would cause an email to be generated, but if you keep some kind of history of the average value of the columns you're interested in, that shouldn't be too difficult.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I find it easier to just use regular SAS to send emails rather than using SAS EG.&amp;nbsp; Let me know if you need sample code for this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What you would need to do, and there are other ways to do this, but this is what came to mind, is something along the lines of:&lt;/P&gt;
&lt;P&gt;1.&amp;nbsp; First you would run a Data step that compares the current maximum value to the average value and if that value is exceeded, then it sets a return code.&lt;/P&gt;
&lt;P&gt;2.&amp;nbsp; Second, you would code a step that executes conditionally -- if the return code is a certain value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At a high level, it might look like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%LET	Return_Code				=	0;

DATA	_NULL_
	SET	&amp;amp;Lib..Avg_Value_History;

	IF	Curr_Max_Value_Col_12	&amp;gt;	Hist_Avg_Max_Value_Col_12	THEN
		CALL	SYMPUTX	('ReturnCode', 4, 'G');
RUN;

%IF	%BQUOTE(&amp;amp;Return_Code)		=	4	%THEN
	%DO;
		%Send_Alert_Email;
	%END;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 22:03:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Email-from-EG-when-bandwidth-exceeded/m-p/747226#M38921</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-06-10T22:03:40Z</dc:date>
    </item>
    <item>
      <title>Re: Email from EG when bandwidth exceeded</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Email-from-EG-when-bandwidth-exceeded/m-p/747239#M38922</link>
      <description>&lt;P&gt;IMHO, you typically use email if you want to let others know about a problem. If it is only for you why not just create an exception or tracking report in a folder where you can just go and view it? Sending an email sounds like an unnecessary complication.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 23:54:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Email-from-EG-when-bandwidth-exceeded/m-p/747239#M38922</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-06-10T23:54:45Z</dc:date>
    </item>
    <item>
      <title>Re: Email from EG when bandwidth exceeded</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Email-from-EG-when-bandwidth-exceeded/m-p/747246#M38923</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not that I disagree entirely with you, but for some processes, if they're critical enough -- or if they so seldom have problems that you might forget to check such a folder, I actually send an email to my smart phone which pops up as a text message.&amp;nbsp; That way, I can jump on a&amp;nbsp; critical problem or get notified of something that so rarely occurs that I might otherwise miss it.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Each to his or her own, I suppose, but that's been helpful to me, particularly the critical issues.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jun 2021 00:30:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Email-from-EG-when-bandwidth-exceeded/m-p/747246#M38923</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-06-11T00:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: Email from EG when bandwidth exceeded</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Email-from-EG-when-bandwidth-exceeded/m-p/747282#M38924</link>
      <description>Hello Ballard&lt;BR /&gt;&lt;BR /&gt;Thanks so much.&lt;BR /&gt;&lt;BR /&gt;Sounds like a good idea to try to go for RANGE after having explored with&lt;BR /&gt;PROC MEANS. But I am in need of a bit of coding help.&lt;BR /&gt;&lt;BR /&gt;I can do step a, define libname and tell EG which dataset to look at and&lt;BR /&gt;which column, by myself.&lt;BR /&gt;&lt;BR /&gt;I can also do step c, define the needed parameters for the mail-sending to&lt;BR /&gt;work, by myself.&lt;BR /&gt;&lt;BR /&gt;But how do I go about the step b, do you perhaps, from your weather coding&lt;BR /&gt;experience, have an example for me about the RANGE statement where I can&lt;BR /&gt;see this live in action, because I am unsure of how this would work?&lt;BR /&gt;&lt;BR /&gt;Basically I think amounts that are far too low or far too high, extremes as&lt;BR /&gt;you call it, are indeed what I am looking for and what I would like SAS to&lt;BR /&gt;mail me about ...&lt;BR /&gt;&lt;BR /&gt;If I set the email for instance to occur weekly, so if the range were small&lt;BR /&gt;usually weekly I would not get a mail ; but one week suddenly a big range&lt;BR /&gt;turns up, it is weird and I would know it already in the beginning of that&lt;BR /&gt;week...&lt;BR /&gt;&lt;BR /&gt;Had you, or anyone else with these weather instruments, already had&lt;BR /&gt;anything like this coded so I could view an example ... or shall I just go&lt;BR /&gt;ahead and try to sort this out on my own and test? Just IF RANGE bigger&lt;BR /&gt;than x Then send mail ; IF RANGE smaller than x Then do nothing or is this&lt;BR /&gt;too simple?&lt;BR /&gt;&lt;BR /&gt;Great help thus far by the way.&lt;BR /&gt;</description>
      <pubDate>Fri, 11 Jun 2021 06:37:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Email-from-EG-when-bandwidth-exceeded/m-p/747282#M38924</guid>
      <dc:creator>heleenw</dc:creator>
      <dc:date>2021-06-11T06:37:24Z</dc:date>
    </item>
    <item>
      <title>Re: Email from EG when bandwidth exceeded</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Email-from-EG-when-bandwidth-exceeded/m-p/747350#M38928</link>
      <description>&lt;P&gt;First of all, I think email is fine to use. Everyone likes their own means of communication and email works well. So does SMS and other means. Email/SMS show up while you are anywhere which is nice.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That out of the way, when I send email I use a service. Our solution involves our own services but it is easy to use SMS or email services (ex. MailChimp using proc http. Look here:&amp;nbsp;&lt;A href="http://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n197g47i7j66x9n15xi0gaha8ov6.htm" target="_blank"&gt;SAS Help Center: Syntax: PROC HTTP PROC HTTP Statement&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You will probably be using a POST command so follow that.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, there are other services other than MailChimp. Pick whichever one works for you and do a&amp;nbsp; REST call. REST makes everything easy w/o having to reinvent the world. There will also be REST calls for SMS.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jun 2021 14:18:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Email-from-EG-when-bandwidth-exceeded/m-p/747350#M38928</guid>
      <dc:creator>AlanC</dc:creator>
      <dc:date>2021-06-11T14:18:30Z</dc:date>
    </item>
    <item>
      <title>Re: Email from EG when bandwidth exceeded</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Email-from-EG-when-bandwidth-exceeded/m-p/748275#M38943</link>
      <description>Hi Jim&lt;BR /&gt;Thanks for your kind reply &amp;amp; offer.&lt;BR /&gt;After having played around with it a little I find that I do actually stand a better chance of understanding this when I can see some sample code from your weather-measurement practice (and possibly a quick word with it)... could you post something or send to me privately, or...?</description>
      <pubDate>Wed, 16 Jun 2021 08:17:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Email-from-EG-when-bandwidth-exceeded/m-p/748275#M38943</guid>
      <dc:creator>heleenw</dc:creator>
      <dc:date>2021-06-16T08:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: Email from EG when bandwidth exceeded</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Email-from-EG-when-bandwidth-exceeded/m-p/748829#M38951</link>
      <description>&lt;P&gt;Below is some code from one of the jobs in my area.&amp;nbsp; I'm not sure who wrote this; I might have done it differently, but hopefully it's sufficient as an example.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some notes:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;You need to have a TO, a FROM, and a SUBJECT on the filename.&amp;nbsp; Your system may have some defaults set up, but generally these should be present.&amp;nbsp; You may also optionally include a CC and a BCC on the file name.&lt;/LI&gt;
&lt;LI&gt;The critical thing on the filename statement is to code EMAIL after the filename.&lt;/LI&gt;
&lt;LI&gt;In your Data step, you should include a FILE statement that references the email Filename.&lt;/LI&gt;
&lt;LI&gt;Notice in the below example that the email Data step is executed conditionally.&amp;nbsp; If &amp;amp;SysErr is &amp;gt; 0 then the email is not sent.&amp;nbsp; In your case, you probably would set some kind of limits that define what your normal range of values is and then send the email if the current value falls outside that range.&amp;nbsp; You could set these limits in a Data step that also includes an email filename (that might be easier in your case) or you can execute a macro as in the below example.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Please ask questions if you have any.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro gen_email(Email_Address_List, Sender, Environment, Table, Nbr);
	FILENAME Mailbox EMAIL
		to		=	("&amp;amp;Email_Address_List")
		from	=	"&amp;amp;Sender"
		subject	=	"&amp;amp;environment Table Lock Alert! Please close *** &amp;amp;Table *** ASAP. (alert #&amp;amp;Nbr)"
		;

	%if &amp;amp;syserr	&amp;gt;	0 %then
		%do;
			%put &amp;amp;Err1  occurred previous to the email step;
		%end;
	%else 
		%do;
			/*email that no errors*/
			DATA _NULL_;
				FILE Mailbox;
				put "/********************  automated message - do not reply to sender  ********************/";
				put " ";
				put "Team,";
				put " ";
				put "&amp;amp;environment Table Lock Alert! Please close ASAP:";
				put " ";
				put "                    &amp;amp;Table ";
				put " ";
				put "This message will be sent every 3 minutes until table is closed.";
				put " ";
				put "This is alert #&amp;amp;Nbr..";
			RUN;
		%end;
%mend;

%gen_email(Some_Email@XXX.com, another_email@XXX.com, Development, Acct04p, 12);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Jim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;P.S.&amp;nbsp; The above assumes that you have something like the below in your SASV9.cfg file.&amp;nbsp; In the below, you would replace "YYYY.XXX.org" with whatever server your organization uses for email.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* set email options */
-EMAILSYS SMTP
-EMAILHOST YYYY.XXX.org
-EMAILPORT 25
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're not sure what those values are, you can run the following, and the values will be written to the log.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC	OPTIONS	OPTION=(EmailSys EmailHost EmailPort);
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the above are not in your SASv9.cfg, you can add that code to your cfg file, if you have access.&amp;nbsp; If you don't have access, you can set those values inside your SAS program like so:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;OPTION	EmailSys=SMTP;
OPTION	EmailHost=YYYY.XXX.org;
OPTION	EmailPort=25;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 18 Jun 2021 20:58:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Email-from-EG-when-bandwidth-exceeded/m-p/748829#M38951</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-06-18T20:58:39Z</dc:date>
    </item>
  </channel>
</rss>

