<?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 merge in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/macro-for-merge/m-p/418731#M102881</link>
    <description>&lt;P&gt;I just want to add that in a real life situation you wouldn't do this mass merge.&amp;nbsp; It is fraught with unseen dangers, such as variables being in different tables, different types, many to many merges etc.&amp;nbsp; Normally you should know your data well, and be able to pick out data items only when needed.&lt;/P&gt;</description>
    <pubDate>Wed, 06 Dec 2017 09:43:05 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-12-06T09:43:05Z</dc:date>
    <item>
      <title>%macro for merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-for-merge/m-p/418722#M102877</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;My requirement here is to merge 'n' number of datasets in a library using a sas macro as that seems to be the feasible solution.The sas datasets' names&amp;nbsp;in the library are all different i.e.,does not start with the same prefix. all the datasets have a common variable which is date and the datasets have to be merged based on date. The data in the datasets are already sorted. I tried using proc sql to first gather all the variables in a macro variable. From there on how should the merge be accomplished?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2017 09:21:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-for-merge/m-p/418722#M102877</guid>
      <dc:creator>sourav22</dc:creator>
      <dc:date>2017-12-06T09:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: %macro for merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-for-merge/m-p/418724#M102879</link>
      <description>&lt;P&gt;The requirement sounds like homework. You don't need the names of the variables to merge the datasets. You need the names of the datasets in the library - the dataset sashelp.vtable holds that information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
  select catx(".", LibName, MemName)
    into :datasetList separated by " "
    from sashelp.vtable
      where LibName = "YOUR_LIB_IN_UPCASE"
  ;
quit;

data work.merged;
  merge &amp;amp;datasetList.;
  by Date;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Dec 2017 09:27:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-for-merge/m-p/418724#M102879</guid>
      <dc:creator>error_prone</dc:creator>
      <dc:date>2017-12-06T09:27:58Z</dc:date>
    </item>
    <item>
      <title>Re: %macro for merge</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-for-merge/m-p/418731#M102881</link>
      <description>&lt;P&gt;I just want to add that in a real life situation you wouldn't do this mass merge.&amp;nbsp; It is fraught with unseen dangers, such as variables being in different tables, different types, many to many merges etc.&amp;nbsp; Normally you should know your data well, and be able to pick out data items only when needed.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Dec 2017 09:43:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-for-merge/m-p/418731#M102881</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-12-06T09:43:05Z</dc:date>
    </item>
  </channel>
</rss>

