<?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 Automation with Macros in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Automation-with-Macros/m-p/19501#M3976</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hima,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Well, I found on one of the programming documents that I needed to do this with my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let Purchases=sum(Total_Retail_Price);&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;title '2007 Purchases by Country';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; select distinct c.Country, &amp;amp;Purchases as Purchases&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; into:Country1, :Country_Purchases1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from orion.Order_Fact as o,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; orion.Customer as c;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, I'm having another problem with the second part of the question which I'll create another post for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for replying!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Mar 2012 00:47:05 GMT</pubDate>
    <dc:creator>InfoAlisaA</dc:creator>
    <dc:date>2012-03-02T00:47:05Z</dc:date>
    <item>
      <title>Automation with Macros</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Automation-with-Macros/m-p/19499#M3974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I am working on a problem where I have to take the problem that I worked on earlier and automate it through creating macros.&lt;/P&gt;&lt;P&gt; I need to take the values of Country and Purchases in my script and modify those to where it writes the first returned row into a macro called Country and Country_Purchases.&lt;/P&gt;&lt;P&gt; This is my first attempt at this script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let Purchases=sum(Total_Retail_Price);&lt;/P&gt;&lt;P&gt;proc sql noprint inobs=1;&lt;/P&gt;&lt;P&gt;title '2007 Purchases by Country';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; select distinct c.Country, &amp;amp;Purchases as Purchases&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; into:Country, :Country_Purchases&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from orion.Order_Fact as o,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; orion.Customer as c&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where o.Customer_ID=c.Customer_ID and&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; year(Order_Date)=2007&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; group by c.Country&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; having &amp;amp;Purchases&amp;gt;1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; order by calculated Purchases desc;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know this is completely wrong as far as reading the first returned row into a macro.&lt;/P&gt;&lt;P&gt;Could someone let me know where I am going wrong with this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alisa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2012 00:28:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Automation-with-Macros/m-p/19499#M3974</guid>
      <dc:creator>InfoAlisaA</dc:creator>
      <dc:date>2012-03-02T00:28:02Z</dc:date>
    </item>
    <item>
      <title>Automation with Macros</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Automation-with-Macros/m-p/19500#M3975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can you paste the log?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2012 00:42:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Automation-with-Macros/m-p/19500#M3975</guid>
      <dc:creator>Hima</dc:creator>
      <dc:date>2012-03-02T00:42:10Z</dc:date>
    </item>
    <item>
      <title>Automation with Macros</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Automation-with-Macros/m-p/19501#M3976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hima,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Well, I found on one of the programming documents that I needed to do this with my code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let Purchases=sum(Total_Retail_Price);&lt;/P&gt;&lt;P&gt;proc sql noprint;&lt;/P&gt;&lt;P&gt;title '2007 Purchases by Country';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; select distinct c.Country, &amp;amp;Purchases as Purchases&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; into:Country1, :Country_Purchases1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from orion.Order_Fact as o,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; orion.Customer as c;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, I'm having another problem with the second part of the question which I'll create another post for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for replying!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Mar 2012 00:47:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Automation-with-Macros/m-p/19501#M3976</guid>
      <dc:creator>InfoAlisaA</dc:creator>
      <dc:date>2012-03-02T00:47:05Z</dc:date>
    </item>
  </channel>
</rss>

