<?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 Error seding  email using SAS Data Integration Studio in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Error-seding-email-using-SAS-Data-Integration-Studio/m-p/737306#M229848</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to send email via Data Integration Studio if I have a specific condition, as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My condition is that if my situation variable, which comes from &amp;amp;_INPUT is =&amp;nbsp; 'true', I send the email, if not, the program ends.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the following code sends the email even if the sitution is = 'false' or any other string. What am I missing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
set &amp;amp;_INPUT;
if situation ='true'
then call symput('message','this is my message');
run;

filename mymail email ("mymail@xxx.com")
	subject='This is my subject';

data _null_;
file mymail;
put "&amp;amp;message";
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Apr 2021 16:12:02 GMT</pubDate>
    <dc:creator>tazz_bh</dc:creator>
    <dc:date>2021-04-27T16:12:02Z</dc:date>
    <item>
      <title>Error seding  email using SAS Data Integration Studio</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-seding-email-using-SAS-Data-Integration-Studio/m-p/737306#M229848</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to send email via Data Integration Studio if I have a specific condition, as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My condition is that if my situation variable, which comes from &amp;amp;_INPUT is =&amp;nbsp; 'true', I send the email, if not, the program ends.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the following code sends the email even if the sitution is = 'false' or any other string. What am I missing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
set &amp;amp;_INPUT;
if situation ='true'
then call symput('message','this is my message');
run;

filename mymail email ("mymail@xxx.com")
	subject='This is my subject';

data _null_;
file mymail;
put "&amp;amp;message";
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Apr 2021 16:12:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-seding-email-using-SAS-Data-Integration-Studio/m-p/737306#M229848</guid>
      <dc:creator>tazz_bh</dc:creator>
      <dc:date>2021-04-27T16:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Error seding  email using SAS Data Integration Studio</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Error-seding-email-using-SAS-Data-Integration-Studio/m-p/737354#M229865</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/375466"&gt;@tazz_bh&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If &lt;FONT face="courier new,courier"&gt;&amp;amp;_INPUT&lt;/FONT&gt; has multiple observations then the condition&amp;nbsp;&lt;FONT face="courier new,courier"&gt;if situation = 'true'&lt;/FONT&gt;&lt;SPAN style="font-family: inherit;"&gt;&amp;nbsp;would be executed in sequence for every record in &lt;FONT face="courier new,courier"&gt;&amp;amp;_INPUT&lt;/FONT&gt;, so if any observation in the input data set allows this condition to be true then &lt;FONT face="courier new,courier"&gt;call symput()&lt;/FONT&gt; will be executed and message will have been set up as a macro variable with the value of "this is my message", and this would not be overwritten.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If &lt;FONT face="courier new,courier"&gt;&amp;amp;_INPUT&lt;/FONT&gt; only has one observation, then you might have to disconnect your SAS session as the macro variable &lt;FONT face="courier new,courier"&gt;message&lt;/FONT&gt; will hold its value between runs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can try testing with a new session with a value of 'false' first and see if that sends the message.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this does not address your issue then please share some of the contents of &lt;FONT face="courier new,courier"&gt;&amp;amp;_INPUT&lt;/FONT&gt;&amp;nbsp;and state how many rows it has.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;/P&gt;
&lt;P&gt;Amir.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Apr 2021 18:03:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Error-seding-email-using-SAS-Data-Integration-Studio/m-p/737354#M229865</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2021-04-27T18:03:36Z</dc:date>
    </item>
  </channel>
</rss>

