<?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 Loop in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-Loop/m-p/297099#M62356</link>
    <description>&lt;P&gt;Please post working code that accomplishes what you want to turn into a macro. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then identify the places that will be dynamic - ie change the data set names.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Sep 2016 02:50:56 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-09-08T02:50:56Z</dc:date>
    <item>
      <title>Macro Loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Loop/m-p/297094#M62354</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi SAS Users,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having multiple SAS datasets in the below mentioned paths.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;libname base "C:/SASUniversityEdition/myfolders/sasuser.v94/base"; /*(e.g. have_base, adverse_base, conmeds_base)*/&lt;BR /&gt;libname current "C:/SASUniversityEdition/myfolders/sasuser.v94/current"; /*(e.g. have_current, adverse_current,conmeds_current)*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now we want to pickup all SAS datasets from the corresponding path and run it on the code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;lile it has to pick up have_base data from /base path and have_current data from /current path then run the code and generate the output in one dataset. AND&lt;BR /&gt;it has to pick up adverse_base data from /base path and adverse_current data from /current path then run the code and generate the output in one dataset.&lt;BR /&gt;finally all output datasets should be one final dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*data in have_base*/&lt;BR /&gt;data have_base;&lt;BR /&gt;input name $ value month $;&lt;BR /&gt;cards;&lt;BR /&gt;bala 402 jun&lt;BR /&gt;sri 593 sep&lt;BR /&gt;sudh 543 jul&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;proc sort data=have_ base;&lt;BR /&gt;by name;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*data in have_current*/&lt;/P&gt;&lt;P&gt;data have_current;&lt;BR /&gt;input name $ value month $;&lt;BR /&gt;cards;&lt;BR /&gt;bal 432 jun&lt;BR /&gt;sri 543 sep&lt;BR /&gt;sudh 563 jul&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;proc sort data=have_current;&lt;BR /&gt;by name;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data both;&lt;BR /&gt;merge have_base(in=a) have_current(in=b);&lt;BR /&gt;by name;&lt;BR /&gt;if a and b;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please do let me know if am not clear.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind Regards,&lt;BR /&gt;Raju&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2016 02:07:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Loop/m-p/297094#M62354</guid>
      <dc:creator>Raj_C</dc:creator>
      <dc:date>2016-09-08T02:07:26Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Loop/m-p/297099#M62356</link>
      <description>&lt;P&gt;Please post working code that accomplishes what you want to turn into a macro. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then identify the places that will be dynamic - ie change the data set names.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2016 02:50:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Loop/m-p/297099#M62356</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-09-08T02:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Loop/m-p/297107#M62359</link>
      <description>&lt;P&gt;Do you mean that have_base, adverse_base, conmeds_base,have_current, adverse_current,conmeds_current all end up in the same data set?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2016 05:30:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Loop/m-p/297107#M62359</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-09-08T05:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Loop/m-p/297111#M62361</link>
      <description>&lt;P&gt;&lt;SPAN&gt;data both;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;merge have_base(in=a) have_current(in=b);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;by name;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if a and b;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;this is the working code.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;now have_base and have_current datasets&amp;nbsp;has to take from the paths which I have mentioned. then it has to check for other datasets (adverse_base and adverse_current) and so on....&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2016 06:06:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Loop/m-p/297111#M62361</guid>
      <dc:creator>Raj_C</dc:creator>
      <dc:date>2016-09-08T06:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: Macro Loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-Loop/m-p/297112#M62362</link>
      <description>&lt;P&gt;not exactly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;we have to pick datasets from the mentioned paths and it has to pass through the following code (first it should check for have_base and base_current then adverse_base and adverse_current and so on.... then finally all outputs should be in one dataset or if we have multiple outputs that is also fine).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;data both;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;merge have_base(in=a) have_current(in=b);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;by name;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;if a and b;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2016 06:11:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-Loop/m-p/297112#M62362</guid>
      <dc:creator>Raj_C</dc:creator>
      <dc:date>2016-09-08T06:11:53Z</dc:date>
    </item>
  </channel>
</rss>

