<?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 SAS email issue when using if then else in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-email-issue-when-using-if-then-else/m-p/379434#M276919</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to send an email with output &amp;nbsp;and email content to &amp;nbsp;valid userid see below &amp;nbsp;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when i'm using set statement , my contents in the emial is not getting displayed i from the "else" part , any idea where i'm doing worng !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename mailbox email;&lt;BR /&gt;data _null_;&lt;BR /&gt;&lt;FONT color="#FF00FF"&gt;set my_log1;&lt;/FONT&gt;&lt;BR /&gt;if &amp;amp;sysuserid='uvm472' then do ;&lt;BR /&gt;file mailbox to="Deepti@yahoo.com" subject='deepti test';&lt;BR /&gt;put _all_;&lt;BR /&gt;end;&lt;BR /&gt;else do;&lt;BR /&gt;file mailbox to="Deepti@yahoo.com" subject='not deepti test';&lt;BR /&gt;&lt;FONT color="#FF00FF"&gt;put " pbdv report is successfull";&lt;/FONT&gt;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jul 2017 15:31:51 GMT</pubDate>
    <dc:creator>Deepti44</dc:creator>
    <dc:date>2017-07-26T15:31:51Z</dc:date>
    <item>
      <title>SAS email issue when using if then else</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-email-issue-when-using-if-then-else/m-p/379434#M276919</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to send an email with output &amp;nbsp;and email content to &amp;nbsp;valid userid see below &amp;nbsp;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;when i'm using set statement , my contents in the emial is not getting displayed i from the "else" part , any idea where i'm doing worng !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename mailbox email;&lt;BR /&gt;data _null_;&lt;BR /&gt;&lt;FONT color="#FF00FF"&gt;set my_log1;&lt;/FONT&gt;&lt;BR /&gt;if &amp;amp;sysuserid='uvm472' then do ;&lt;BR /&gt;file mailbox to="Deepti@yahoo.com" subject='deepti test';&lt;BR /&gt;put _all_;&lt;BR /&gt;end;&lt;BR /&gt;else do;&lt;BR /&gt;file mailbox to="Deepti@yahoo.com" subject='not deepti test';&lt;BR /&gt;&lt;FONT color="#FF00FF"&gt;put " pbdv report is successfull";&lt;/FONT&gt;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 15:31:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-email-issue-when-using-if-then-else/m-p/379434#M276919</guid>
      <dc:creator>Deepti44</dc:creator>
      <dc:date>2017-07-26T15:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: SAS email issue when using if then else</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-email-issue-when-using-if-then-else/m-p/379495#M276920</link>
      <description>&lt;P&gt;I see three things I would encourage you&amp;nbsp;to look at.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Comparing a macro variable to a character constant in a data step IF statement is probably not what you want. I don't know what the value of &amp;amp;SYSUSERID would be, but supposing it is something like USER100, this would be a word that SAS would treat as a variable name. Then the results of this would depend on whether there is a variable called USER100 in the data set MYLOG1.&lt;/LI&gt;
&lt;LI&gt;When a data step contains&amp;nbsp;multiple FILE statements with the same fileref (MAILBOX in this example) containing options, I believe the data step consolidates&amp;nbsp;those options the same as if they all appeared in one statement. This means you can't use IF-THEN statements to control FILE statement options.&lt;/LI&gt;
&lt;LI&gt;To use a data step to control email options or to send more than one message from one data step it is usually necessary to use email directives. For example, you might write
&lt;PRE class="xis-codeFragment"&gt;put '!em_to! ' to_email;&lt;/PRE&gt;
to set the recipient based on the value of a data step variable. For the details of the directives, see "PUT Statement Email Directives" at&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl/en/lestmtsref/69738/HTML/default/viewer.htm#n0ig2krarrz6vtn1aw9zzvtez4qo.htm" target="_self"&gt;http://support.sas.com/documentation/cdl/en/lestmtsref/69738/HTML/default/viewer.htm#n0ig2krarrz6vtn1aw9zzvtez4qo.htm&lt;/A&gt;.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Sorry for the short reply. I hope some of this helps.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jul 2017 18:18:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-email-issue-when-using-if-then-else/m-p/379495#M276920</guid>
      <dc:creator>RickAster</dc:creator>
      <dc:date>2017-07-26T18:18:09Z</dc:date>
    </item>
  </channel>
</rss>

