<?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: Macro for interpolation &amp;amp; log-transformation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-interpolation-amp-log-transformation/m-p/851017#M336325</link>
    <description>&lt;P&gt;It is possible. I see you run this proc once for each variable. Then we need two macros: &lt;BR /&gt;1) a simple macro with a button for dataset only, e.g., &lt;BR /&gt;%macro logger (dsn); *dsn - data set name;&lt;BR /&gt;Proc expand data=&amp;amp;dsn;&amp;nbsp;&lt;BR /&gt;… /* your code here */&lt;BR /&gt;Convert &amp;amp;var = &amp;amp;var._interpl;&lt;BR /&gt;…&lt;BR /&gt;Run;&lt;BR /&gt;%mend;&lt;BR /&gt;&lt;BR /&gt;And 2) the driver macro that would iterate over variable list calling the logger macro on each one of them:&lt;BR /&gt;E.g.,&lt;BR /&gt;%macro driver(list);&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/sastraining/2015/01/30/sas-authors-tip-getting-the-macro-language-to-perform-a-do-loop-over-a-list-of-values/" target="_blank" rel="noopener"&gt;https://blogs.sas.com/content/sastraining/2015/01/30/sas-authors-tip-getting-the-macro-language-to-perform-a-do-loop-over-a-list-of-values/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Here is how driver macro calls logger macro:&lt;BR /&gt;%macro driver(list); *list - your variable list;&lt;BR /&gt;… stuff from blog with countw etc&lt;BR /&gt;%let a = %scan… stuff from blog&lt;BR /&gt;%logger(&amp;amp;dsn) /*your real dataset name here in parenthesis, not &amp;amp;dsn*/&lt;BR /&gt;…&lt;BR /&gt;%mend driver;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let list = var1 var2 var3;&lt;/P&gt;
&lt;P&gt;%driver(list) /*this will do the job*/&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if you turn on the &lt;BR /&gt;Options mprint; you will see that driver calls logger for each variable.&lt;/P&gt;</description>
    <pubDate>Sat, 24 Dec 2022 03:08:31 GMT</pubDate>
    <dc:creator>pink_poodle</dc:creator>
    <dc:date>2022-12-24T03:08:31Z</dc:date>
    <item>
      <title>Macro for interpolation &amp; log-transformation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-interpolation-amp-log-transformation/m-p/851011#M336322</link>
      <description>&lt;P&gt;Hi everyone !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wrote the following code to interpolate and log-transform data. I would like to know how to create a macro that does this job. Thank you for your help&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face_with_sweat:"&gt;😅&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc expand data=Projet.feuille1
from=day to=day
out=Projet.feuille1_interpl;
id Date;
convert France__Equity_Indices__Euronext=index_interpl / observed = total
transformout=(log);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2022 22:28:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-for-interpolation-amp-log-transformation/m-p/851011#M336322</guid>
      <dc:creator>_vichz</dc:creator>
      <dc:date>2022-12-23T22:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for interpolation &amp; log-transformation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-interpolation-amp-log-transformation/m-p/851012#M336323</link>
      <description>&lt;P&gt;Which parts of the code need to be dynamic?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2022 22:40:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-for-interpolation-amp-log-transformation/m-p/851012#M336323</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-12-23T22:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for interpolation &amp; log-transformation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-interpolation-amp-log-transformation/m-p/851014#M336324</link>
      <description>&lt;P&gt;Thank you for your reply &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp;. Ideally, I'd like a macro with two arguments, the dataset and the variable I want to transform, but I don't think it's possible&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_squinting_face:"&gt;😆&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2022 23:15:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-for-interpolation-amp-log-transformation/m-p/851014#M336324</guid>
      <dc:creator>_vichz</dc:creator>
      <dc:date>2022-12-23T23:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for interpolation &amp; log-transformation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-interpolation-amp-log-transformation/m-p/851017#M336325</link>
      <description>&lt;P&gt;It is possible. I see you run this proc once for each variable. Then we need two macros: &lt;BR /&gt;1) a simple macro with a button for dataset only, e.g., &lt;BR /&gt;%macro logger (dsn); *dsn - data set name;&lt;BR /&gt;Proc expand data=&amp;amp;dsn;&amp;nbsp;&lt;BR /&gt;… /* your code here */&lt;BR /&gt;Convert &amp;amp;var = &amp;amp;var._interpl;&lt;BR /&gt;…&lt;BR /&gt;Run;&lt;BR /&gt;%mend;&lt;BR /&gt;&lt;BR /&gt;And 2) the driver macro that would iterate over variable list calling the logger macro on each one of them:&lt;BR /&gt;E.g.,&lt;BR /&gt;%macro driver(list);&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/sastraining/2015/01/30/sas-authors-tip-getting-the-macro-language-to-perform-a-do-loop-over-a-list-of-values/" target="_blank" rel="noopener"&gt;https://blogs.sas.com/content/sastraining/2015/01/30/sas-authors-tip-getting-the-macro-language-to-perform-a-do-loop-over-a-list-of-values/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Here is how driver macro calls logger macro:&lt;BR /&gt;%macro driver(list); *list - your variable list;&lt;BR /&gt;… stuff from blog with countw etc&lt;BR /&gt;%let a = %scan… stuff from blog&lt;BR /&gt;%logger(&amp;amp;dsn) /*your real dataset name here in parenthesis, not &amp;amp;dsn*/&lt;BR /&gt;…&lt;BR /&gt;%mend driver;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let list = var1 var2 var3;&lt;/P&gt;
&lt;P&gt;%driver(list) /*this will do the job*/&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if you turn on the &lt;BR /&gt;Options mprint; you will see that driver calls logger for each variable.&lt;/P&gt;</description>
      <pubDate>Sat, 24 Dec 2022 03:08:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-for-interpolation-amp-log-transformation/m-p/851017#M336325</guid>
      <dc:creator>pink_poodle</dc:creator>
      <dc:date>2022-12-24T03:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for interpolation &amp; log-transformation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-interpolation-amp-log-transformation/m-p/851033#M336332</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/235176"&gt;@pink_poodle&lt;/a&gt;&amp;nbsp;thank you very much for taking the time to reply ! I will try your solution&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Dec 2022 19:37:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-for-interpolation-amp-log-transformation/m-p/851033#M336332</guid>
      <dc:creator>_vichz</dc:creator>
      <dc:date>2022-12-24T19:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for interpolation &amp; log-transformation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-interpolation-amp-log-transformation/m-p/851145#M336380</link>
      <description>Thank you! please let me know if you have any questions.</description>
      <pubDate>Mon, 26 Dec 2022 16:06:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-for-interpolation-amp-log-transformation/m-p/851145#M336380</guid>
      <dc:creator>pink_poodle</dc:creator>
      <dc:date>2022-12-26T16:06:21Z</dc:date>
    </item>
  </channel>
</rss>

