<?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 Macros help in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macros-help/m-p/44213#M9060</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You didn't include any sample data, but it appears that you are re-creating a.test each time that you run the macro.&amp;nbsp; Don't you really want to create it at the beginning of your code and then simply update it each time you run your macro?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Feb 2012 17:19:47 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2012-02-02T17:19:47Z</dc:date>
    <item>
      <title>Macros help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-help/m-p/44212#M9059</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;I have a macro set up that calculates the days inbetween two dates:&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;%MACRO DAYS_DIFF(CURR_PER,PREV_PER);&lt;/P&gt;&lt;P&gt;DATA A.TEST; SET A.PAYMENT_CHARGE_&amp;amp;TIMESTAMP;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; IF ME_S&amp;amp;CURR_PER='A' THEN DO;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF ABS(INTCK('DAYS',CM&amp;amp;CURR_PER,PM&amp;amp;CURR_PER))&amp;lt;ABS(INTCK('DAYS',CM&amp;amp;CURR_PER,PM&amp;amp;PREV_PER)) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; THEN DAYS_DIFF_&amp;amp;CURR_PER=INTCK('DAYS',CM&amp;amp;CURR_PER,PM&amp;amp;CURR_PER); &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ELSE DAYS_DIFF_&amp;amp;CURR_PER=INTCK('DAYS',CM&amp;amp;CURR_PER,PM&amp;amp;PREV_PER);&lt;/P&gt;&lt;P&gt;END;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; IF ME_S&amp;amp;CURR_PER='S' AND CM&amp;amp;CURR_PER^=. THEN DAYS_DIFF_&amp;amp;CURR_PER=INTCK('DAYS',&amp;amp;CUTOFF_DATE,CM&amp;amp;CURR_PER); &lt;/P&gt;&lt;P&gt;IF ME_S&amp;amp;CURR_PER='C' AND CM&amp;amp;CURR_PER^=. THEN DAYS_DIFF_&amp;amp;CURR_PER=INTCK('DAYS',&amp;amp;CUTOFF_DATE,ME_D&amp;amp;CURR_PER); &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;%MEND;&lt;/P&gt;&lt;P&gt;%DAYS_DIFF(1,2);&lt;/P&gt;&lt;P&gt;%DAYS_DIFF(2,3);&lt;/P&gt;&lt;P&gt;%DAYS_DIFF(3,4);&lt;/P&gt;&lt;P&gt;%DAYS_DIFF(4,5);&lt;/P&gt;&lt;P&gt;%DAYS_DIFF(5,6);&lt;/P&gt;&lt;P&gt;%DAYS_DIFF(6,7);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i run this i will get an output of the last variable: DAYS_DIFF_6&lt;/P&gt;&lt;P&gt;i'm having troubles creating the final dataset that will combine all the DAYS_DIFF_1 - DAYS_DIFF_6 onto one dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Feb 2012 16:35:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-help/m-p/44212#M9059</guid>
      <dc:creator>Danglytics</dc:creator>
      <dc:date>2012-02-02T16:35:02Z</dc:date>
    </item>
    <item>
      <title>Macros help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-help/m-p/44213#M9060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You didn't include any sample data, but it appears that you are re-creating a.test each time that you run the macro.&amp;nbsp; Don't you really want to create it at the beginning of your code and then simply update it each time you run your macro?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Feb 2012 17:19:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-help/m-p/44213#M9060</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-02-02T17:19:47Z</dc:date>
    </item>
    <item>
      <title>Macros help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macros-help/m-p/44214#M9061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As Art says take the DATA , SET and RUN statements out of the macro so that it only generates the code to create the new variables. Then place the calls to the macro inside of a data step.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Feb 2012 17:24:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macros-help/m-p/44214#M9061</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-02-02T17:24:35Z</dc:date>
    </item>
  </channel>
</rss>

