<?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: Email Macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Email-Macro/m-p/186322#M35301</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure what you are trying to do, is this all your code?&amp;nbsp; Does the rectype come from the output of the shewhart procedure or is it something you put in by hand.&amp;nbsp; The definition of the macro variable needs to appear before the actual use.&amp;nbsp; So you could do:&lt;/P&gt;&lt;P&gt;%let rectype=recordtype;&lt;/P&gt;&lt;P&gt;%let headin=This is a &amp;amp;rectype. heading;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have other errors there though.&amp;nbsp; For instance you have a semicolon after your &amp;amp;recType macro reference which means the style is invalid.&amp;nbsp; Macro variables are delimited by a dot, e.g. &amp;amp;RecType. style=ocean.&lt;/P&gt;&lt;P&gt;As for the line:&lt;/P&gt;&lt;P&gt;ODS PDF FILE="C:\Desktop\OUTLIERS2.pdf" &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;&amp;amp;RecType&lt;/STRONG&gt;&lt;/SPAN&gt;;&amp;nbsp; STYLE=OCEAN;&lt;/P&gt;&lt;P&gt;What is RecType to be as there is no option on an ods line (except select/exclude)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps provide a clear example with test data of what you have and what you want.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Jan 2015 13:26:35 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2015-01-16T13:26:35Z</dc:date>
    <item>
      <title>Email Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Email-Macro/m-p/186321#M35300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am new to SAS.&amp;nbsp; I have started a macro that creates a file each time a Rectype has an outlier identified in the control chart.&amp;nbsp; I would like to create a new file each RecType has a outlier identifed in the shewhart statement for the most recent month.&amp;nbsp; I have tried adding the variable(&amp;amp;RecType) in the ODS File statement, however I have had no luck.&amp;nbsp; Any suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ODS PDF FILE="C:\Desktop\OUTLIERS2.pdf" &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;&amp;amp;RecType&lt;/STRONG&gt;&lt;/SPAN&gt;;&amp;nbsp; STYLE=OCEAN;&lt;BR /&gt;%Let Heading=RecType&lt;/P&gt;&lt;P&gt;proc shewhart data=work.OUTLIERS2; xchart _SUBX_* MONYEAR /sigmas=2; run;&lt;BR /&gt;RUN;&lt;BR /&gt;ODS PDF CLOSE;&lt;BR /&gt;ods listing;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 13:18:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Email-Macro/m-p/186321#M35300</guid>
      <dc:creator>thomask23</dc:creator>
      <dc:date>2015-01-16T13:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: Email Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Email-Macro/m-p/186322#M35301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure what you are trying to do, is this all your code?&amp;nbsp; Does the rectype come from the output of the shewhart procedure or is it something you put in by hand.&amp;nbsp; The definition of the macro variable needs to appear before the actual use.&amp;nbsp; So you could do:&lt;/P&gt;&lt;P&gt;%let rectype=recordtype;&lt;/P&gt;&lt;P&gt;%let headin=This is a &amp;amp;rectype. heading;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have other errors there though.&amp;nbsp; For instance you have a semicolon after your &amp;amp;recType macro reference which means the style is invalid.&amp;nbsp; Macro variables are delimited by a dot, e.g. &amp;amp;RecType. style=ocean.&lt;/P&gt;&lt;P&gt;As for the line:&lt;/P&gt;&lt;P&gt;ODS PDF FILE="C:\Desktop\OUTLIERS2.pdf" &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;&amp;amp;RecType&lt;/STRONG&gt;&lt;/SPAN&gt;;&amp;nbsp; STYLE=OCEAN;&lt;/P&gt;&lt;P&gt;What is RecType to be as there is no option on an ods line (except select/exclude)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps provide a clear example with test data of what you have and what you want.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 13:26:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Email-Macro/m-p/186322#M35301</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-01-16T13:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: Email Macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Email-Macro/m-p/186323#M35302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you really are new to SAS, be careful with how soon you start writing macros.&amp;nbsp; The (main) purpose of the macro language is to generate SAS code.&amp;nbsp; Usually it makes sense to spend time writing (and debugging) your own SAS code until you are comfortable with that, before adding in the complexity of automated code generation.&amp;nbsp; There is plenty you can do with SAS without worrying about macros.&amp;nbsp; Even non-macro ways to do code generation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That said, if you are sure you want to dive in to macros, sometimes a way to start is to write your SAS code first and get it working, and then convert it into a macro. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--Q.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Jan 2015 15:41:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Email-Macro/m-p/186323#M35302</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2015-01-16T15:41:26Z</dc:date>
    </item>
  </channel>
</rss>

