<?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: Condionally send email from SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Condionally-send-email-from-SAS/m-p/518344#M140279</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data fsystem.dset1 fsystem.dset2;
if var1=var2 then do;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Since there is no set statement, and no other means from which var1 and var2 could get a value, both will be missing and therefore equal. Always.&lt;/P&gt;</description>
    <pubDate>Tue, 04 Dec 2018 10:25:58 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-12-04T10:25:58Z</dc:date>
    <item>
      <title>Condionally send email from SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Condionally-send-email-from-SAS/m-p/518334#M140276</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname fsystem '/user/data/lives/here';
filename report email "person1@yahoo.com";

data fsystem.dset3;&lt;BR /&gt;merge fsystem.dset1 fsystem.dset2;
if var1=var2 then do;
	put 'Variables are equal';
	put 'var1=' var1 'var2=' var2;
	call system ('sas /progs/live/here/prog1.sas');
end;
else do;
	file report
		to=('person1@yahoo.com'
		    'person2@yahoo.com')
		subject="NOTIFICATION EMAIL"
		type='text/html'
		attach=("/user/data/lives/here/prog1.log");
put 'Variables are unequal"
put 'var1=' var1 'var2=' var2;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I would like to conditionally send an email when var1&amp;nbsp;DOES NOT EQAUL&amp;nbsp;var2. However, the email currently gets sent regardless of whether or not the two variables are equal. How can I fix this issue? Please advise. Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 15:04:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Condionally-send-email-from-SAS/m-p/518334#M140276</guid>
      <dc:creator>ijmoorejr</dc:creator>
      <dc:date>2018-12-04T15:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: Condionally send email from SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Condionally-send-email-from-SAS/m-p/518342#M140278</link>
      <description>&lt;P&gt;Something like:&lt;/P&gt;
&lt;PRE&gt;/* Macro has the send mail bits in it */
%macro SendMail ();
  data _null_;
    ...
  run;
%mend SendMail;

data _null_;
  set ???;
  if var1=var2 then call system (...);
  else call execute('%SendMail;');
run;&lt;/PRE&gt;
&lt;P&gt;Note you do not appear to set any dataset in the data fsytem... datastep, therfore there is no var1 or var 2.&amp;nbsp; You do have two output datasets, which never get used?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 10:10:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Condionally-send-email-from-SAS/m-p/518342#M140278</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-12-04T10:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Condionally send email from SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Condionally-send-email-from-SAS/m-p/518344#M140279</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data fsystem.dset1 fsystem.dset2;
if var1=var2 then do;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Since there is no set statement, and no other means from which var1 and var2 could get a value, both will be missing and therefore equal. Always.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 10:25:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Condionally-send-email-from-SAS/m-p/518344#M140279</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-12-04T10:25:58Z</dc:date>
    </item>
  </channel>
</rss>

