<?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: Conditional E-mail Report in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Conditional-E-mail-Report/m-p/569348#M160442</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;its given an error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;SELECT count(DISTINCT ID) into :numPeople&lt;BR /&gt;FROM MAGAZA_EXCEL;&lt;BR /&gt;%let numPeople = &amp;amp;numPeople;&lt;BR /&gt;quit;&lt;BR /&gt;proc sql;&lt;BR /&gt;SELECT DISTINCT ID&lt;BR /&gt;into :ID - :ID&amp;amp;numPeople, :mail - :mail&amp;amp;numPeople&lt;BR /&gt;FROM MAGAZA_EXCEL;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%macro send_report_emails();&lt;BR /&gt;%do i=1 %to &amp;amp;numPeople;&lt;BR /&gt;%let ID = &amp;amp;&amp;amp;ID&amp;amp;i;&lt;BR /&gt;%let to = &amp;amp;&amp;amp;mail&amp;amp;i;&lt;BR /&gt;&lt;BR /&gt;options emailhost=("smtp.office365.com" port=xxx STARTTLS auth=login id="trreport@xxxx" pw="xxxxx") emailid="trreport@yrnet.com" emailpw="xxxxx";&lt;BR /&gt;&lt;BR /&gt;filename mymail email "&amp;amp;to" SUBJECT = "Report Status" from="trreport@xxxx" content_type="application\xlsx" ;&lt;BR /&gt;&lt;BR /&gt;data _null_;&lt;BR /&gt;put "The following reports are complete: &amp;amp;ca";&lt;BR /&gt;put "The following reports are complete: &amp;amp;debit";&lt;/P&gt;&lt;P&gt;run;&lt;BR /&gt;%end;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%mend send_report_emails;&lt;BR /&gt;%send_report_emails;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jun 2019 07:17:48 GMT</pubDate>
    <dc:creator>gizeme</dc:creator>
    <dc:date>2019-06-27T07:17:48Z</dc:date>
    <item>
      <title>Conditional E-mail Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditional-E-mail-Report/m-p/569011#M160289</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I have a report with store sales information. This information is kept on a separate line for each store. I would like to send this information to the stores on a daily basis. but each store must send its own figures in the mail. how can I do that?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 08:14:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditional-E-mail-Report/m-p/569011#M160289</guid>
      <dc:creator>gizeme</dc:creator>
      <dc:date>2019-06-26T08:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional E-mail Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditional-E-mail-Report/m-p/569022#M160296</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/279058"&gt;@gizeme&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You create a report per store and then send this store specific report to the store specific email address.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First step: Write the program which creates the report and sends it via email for a single store.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then wrap a macro around this code and replace the relevant bits (like the email address) with macro variables which you can pass in as parameters to the macro.&lt;/P&gt;
&lt;P&gt;Now create a data set with these parameters per store (1 row per store) and use a call execute where you call the macro and pass in the parameter values (1 call of the macro per store).&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2019 09:00:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditional-E-mail-Report/m-p/569022#M160296</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-06-26T09:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional E-mail Report</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Conditional-E-mail-Report/m-p/569348#M160442</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;its given an error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;SELECT count(DISTINCT ID) into :numPeople&lt;BR /&gt;FROM MAGAZA_EXCEL;&lt;BR /&gt;%let numPeople = &amp;amp;numPeople;&lt;BR /&gt;quit;&lt;BR /&gt;proc sql;&lt;BR /&gt;SELECT DISTINCT ID&lt;BR /&gt;into :ID - :ID&amp;amp;numPeople, :mail - :mail&amp;amp;numPeople&lt;BR /&gt;FROM MAGAZA_EXCEL;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%macro send_report_emails();&lt;BR /&gt;%do i=1 %to &amp;amp;numPeople;&lt;BR /&gt;%let ID = &amp;amp;&amp;amp;ID&amp;amp;i;&lt;BR /&gt;%let to = &amp;amp;&amp;amp;mail&amp;amp;i;&lt;BR /&gt;&lt;BR /&gt;options emailhost=("smtp.office365.com" port=xxx STARTTLS auth=login id="trreport@xxxx" pw="xxxxx") emailid="trreport@yrnet.com" emailpw="xxxxx";&lt;BR /&gt;&lt;BR /&gt;filename mymail email "&amp;amp;to" SUBJECT = "Report Status" from="trreport@xxxx" content_type="application\xlsx" ;&lt;BR /&gt;&lt;BR /&gt;data _null_;&lt;BR /&gt;put "The following reports are complete: &amp;amp;ca";&lt;BR /&gt;put "The following reports are complete: &amp;amp;debit";&lt;/P&gt;&lt;P&gt;run;&lt;BR /&gt;%end;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%mend send_report_emails;&lt;BR /&gt;%send_report_emails;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 07:17:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Conditional-E-mail-Report/m-p/569348#M160442</guid>
      <dc:creator>gizeme</dc:creator>
      <dc:date>2019-06-27T07:17:48Z</dc:date>
    </item>
  </channel>
</rss>

