<?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 how to put macro variable in an automatic email sent through sas in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-put-macro-variable-in-an-automatic-email-sent-through-sas/m-p/569364#M160452</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i need to put a macro variable (number of obs in a dataset) into the code that send an automatic email with sas.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I count the number of obs with this sql:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;BR /&gt;select count(*)&lt;BR /&gt;into :count&lt;BR /&gt;from lista&lt;BR /&gt;;&lt;BR /&gt;quit;&lt;BR /&gt;%put Count=&amp;amp;count.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and then i need to put &amp;amp;count into the automatic email that i want to send, i tried in this way:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename mymail email&lt;BR /&gt;from=("XXX")&lt;BR /&gt;to=("XXX")&lt;BR /&gt;subject="Daily report"&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;file mymail;&lt;BR /&gt;put 'Hi,';&lt;BR /&gt;put 'here the daily numbers of record';&lt;BR /&gt;put '&amp;amp;count'.;&lt;BR /&gt;put 'Ciao';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apparently it doesn't working. Could you please help me?&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jun 2019 08:45:46 GMT</pubDate>
    <dc:creator>Tiri6</dc:creator>
    <dc:date>2019-06-27T08:45:46Z</dc:date>
    <item>
      <title>how to put macro variable in an automatic email sent through sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-put-macro-variable-in-an-automatic-email-sent-through-sas/m-p/569364#M160452</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i need to put a macro variable (number of obs in a dataset) into the code that send an automatic email with sas.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I count the number of obs with this sql:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;BR /&gt;select count(*)&lt;BR /&gt;into :count&lt;BR /&gt;from lista&lt;BR /&gt;;&lt;BR /&gt;quit;&lt;BR /&gt;%put Count=&amp;amp;count.;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and then i need to put &amp;amp;count into the automatic email that i want to send, i tried in this way:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename mymail email&lt;BR /&gt;from=("XXX")&lt;BR /&gt;to=("XXX")&lt;BR /&gt;subject="Daily report"&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;file mymail;&lt;BR /&gt;put 'Hi,';&lt;BR /&gt;put 'here the daily numbers of record';&lt;BR /&gt;put '&amp;amp;count'.;&lt;BR /&gt;put 'Ciao';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apparently it doesn't working. Could you please help me?&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 08:45:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-put-macro-variable-in-an-automatic-email-sent-through-sas/m-p/569364#M160452</guid>
      <dc:creator>Tiri6</dc:creator>
      <dc:date>2019-06-27T08:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to put macro variable in an automatic email sent through sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-put-macro-variable-in-an-automatic-email-sent-through-sas/m-p/569367#M160454</link>
      <description>&lt;P&gt;A more efficient way to get the obs count is by using dictionary.tables, as it only reads the dataset header:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
select nobs into :count from dictionary.tables
where libname ="WORK" and memname = "LISTA";
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For your question, macro variables are not resolved inside single quotes; use double quotes instead.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 08:58:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-put-macro-variable-in-an-automatic-email-sent-through-sas/m-p/569367#M160454</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-06-27T08:58:38Z</dc:date>
    </item>
  </channel>
</rss>

