<?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 Merge Several Datasets Having The Same Variable Names in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Merge-Several-Datasets-Having-The-Same-Variable-Names/m-p/282335#M59171</link>
    <description>&lt;P&gt;I want to merge 9 files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Each of the files has the same 3 variables:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;X, Y, Percent &amp;nbsp;(out datasets from 9 Proc Freq runs)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Two issues come up:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-- Do I have to rename Y in each of the files beforehand? &amp;nbsp;(Doesn't SAS automatically do that?)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-- I don't want to keep the Percent column in any of the files. How to most easily dump that one?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data merged;
merge one
merge two
merge three;
.
merge nine
by X;
run
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help greatly appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nicholas Kormanik&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 06 Jul 2016 02:45:17 GMT</pubDate>
    <dc:creator>NKormanik</dc:creator>
    <dc:date>2016-07-06T02:45:17Z</dc:date>
    <item>
      <title>Merge Several Datasets Having The Same Variable Names</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Merge-Several-Datasets-Having-The-Same-Variable-Names/m-p/282335#M59171</link>
      <description>&lt;P&gt;I want to merge 9 files.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Each of the files has the same 3 variables:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;X, Y, Percent &amp;nbsp;(out datasets from 9 Proc Freq runs)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Two issues come up:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-- Do I have to rename Y in each of the files beforehand? &amp;nbsp;(Doesn't SAS automatically do that?)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-- I don't want to keep the Percent column in any of the files. How to most easily dump that one?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data merged;
merge one
merge two
merge three;
.
merge nine
by X;
run
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help greatly appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nicholas Kormanik&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2016 02:45:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Merge-Several-Datasets-Having-The-Same-Variable-Names/m-p/282335#M59171</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2016-07-06T02:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: Merge Several Datasets Having The Same Variable Names</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Merge-Several-Datasets-Having-The-Same-Variable-Names/m-p/282336#M59172</link>
      <description>&lt;P&gt;You have to rename Y since SAS would not do it for you, Keep the variables you need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data merged;
merge 
one(keep=x y rename=(y=y1))
two(keep=x y rename=(y=y2)
three(keep=x y rename=(y=y3))
....
nine(keep=x y rename=(y=y9));
by X;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Jul 2016 02:53:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Merge-Several-Datasets-Having-The-Same-Variable-Names/m-p/282336#M59172</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-07-06T02:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: Merge Several Datasets Having The Same Variable Names</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Merge-Several-Datasets-Having-The-Same-Variable-Names/m-p/282342#M59173</link>
      <description>&lt;P&gt;Thank you,&amp;nbsp;&lt;SPAN&gt;Xia Keshan! &amp;nbsp;Beautifully done.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;By the way, really good to see you back here. &amp;nbsp;What a wonderful asset to this community.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Nicholas&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2016 04:27:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Merge-Several-Datasets-Having-The-Same-Variable-Names/m-p/282342#M59173</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2016-07-06T04:27:09Z</dc:date>
    </item>
  </channel>
</rss>

