<?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: merge or set in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/merge-or-set/m-p/243913#M45412</link>
    <description>&lt;P&gt;Thank you very&amp;nbsp; much. This works.&lt;/P&gt;&lt;P&gt;The problem is my original two tables are generated by sas macro. It is time consuming to change name one by one.&lt;/P&gt;&lt;P&gt;Would you please provide sas macro code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Jan 2016 20:48:56 GMT</pubDate>
    <dc:creator>Bal23</dc:creator>
    <dc:date>2016-01-15T20:48:56Z</dc:date>
    <item>
      <title>merge or set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merge-or-set/m-p/243891#M45407</link>
      <description>&lt;P&gt;my merge statment generates missing value for the first dataset&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;plesae see the attached two datasets. the real datasets are very long with many columns.&lt;/P&gt;&lt;P&gt;These two datasets were generated by sas macro.&lt;/P&gt;&lt;P&gt;Now I want to merge these two together.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data first;&lt;BR /&gt;set first1 first2;&lt;BR /&gt;by _NAME_;&lt;BR /&gt;run;&lt;BR /&gt;proc print data = first;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;the problem is,&lt;/P&gt;&lt;P&gt;the data generated actually put the first one into the first one, and the second one, the values are all missing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sample datasets attached&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2016 19:19:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merge-or-set/m-p/243891#M45407</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-01-15T19:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: merge or set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merge-or-set/m-p/243901#M45408</link>
      <description>&lt;P&gt;I just ran the following code, I'll paste my output below.&amp;nbsp; Not sure what you are looking for but if that's the output you are getting I'd check the inputs:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data one;&lt;BR /&gt;infile cards dsd;&lt;BR /&gt;informat name $3. _1af _1af2 8.; &lt;BR /&gt;input name _1af _1af2;&lt;BR /&gt;cards;&lt;BR /&gt;c1a,1083,187&lt;BR /&gt;;run;&lt;BR /&gt;&lt;BR /&gt;data two;&lt;BR /&gt;infile cards dsd;&lt;BR /&gt;informat name $3. _2af _2f2 8.;&lt;BR /&gt;input name$ _2af _2f2;&lt;BR /&gt;cards;&lt;BR /&gt;c1a,1083,187&lt;BR /&gt;;run;&lt;BR /&gt;&lt;BR /&gt;data want;&lt;BR /&gt;set one two;&lt;BR /&gt;by name;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE width="185"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="42"&gt;name&lt;/TD&gt;
&lt;TD width="35"&gt;_1af&lt;/TD&gt;
&lt;TD width="40"&gt;_1af2&lt;/TD&gt;
&lt;TD width="35"&gt;_2af&lt;/TD&gt;
&lt;TD width="33"&gt;_2f2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;c1a&lt;/TD&gt;
&lt;TD&gt;1083&lt;/TD&gt;
&lt;TD&gt;187&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;c1a&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;1083&lt;/TD&gt;
&lt;TD&gt;187&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Fri, 15 Jan 2016 20:14:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merge-or-set/m-p/243901#M45408</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2016-01-15T20:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: merge or set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merge-or-set/m-p/243907#M45410</link>
      <description>&lt;P&gt;Thanks. Now I understand why you are confused. No wonder why SAS is confused too.&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;i want to have a table

name  _af1  _af2
c1a       1086  187
c2a      1083   1

i need them to be vertically added, not horizontally appended
i hope it is clear enough&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;name&lt;/TD&gt;&lt;TD&gt;_1af&lt;/TD&gt;&lt;TD&gt;_1af2&lt;/TD&gt;&lt;TD&gt;_2af&lt;/TD&gt;&lt;TD&gt;_2f2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;c1a&lt;/TD&gt;&lt;TD&gt;1083&lt;/TD&gt;&lt;TD&gt;187&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;c1a&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;1083&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Fri, 15 Jan 2016 20:32:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merge-or-set/m-p/243907#M45410</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-01-15T20:32:21Z</dc:date>
    </item>
    <item>
      <title>Re: merge or set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merge-or-set/m-p/243908#M45411</link>
      <description>&lt;P&gt;You need to change the variables in the second dataset:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;BR /&gt;set one&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; two(rename=(_2af=_1af _2f2=_1af2));&lt;BR /&gt;by name;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2016 20:36:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merge-or-set/m-p/243908#M45411</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2016-01-15T20:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: merge or set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merge-or-set/m-p/243913#M45412</link>
      <description>&lt;P&gt;Thank you very&amp;nbsp; much. This works.&lt;/P&gt;&lt;P&gt;The problem is my original two tables are generated by sas macro. It is time consuming to change name one by one.&lt;/P&gt;&lt;P&gt;Would you please provide sas macro code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2016 20:48:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merge-or-set/m-p/243913#M45412</guid>
      <dc:creator>Bal23</dc:creator>
      <dc:date>2016-01-15T20:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: merge or set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merge-or-set/m-p/243917#M45413</link>
      <description>&lt;P&gt;If you are generating the names in a macro then that would be the place to execute this code while the macro knows what they are.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2016 20:51:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merge-or-set/m-p/243917#M45413</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-01-15T20:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: merge or set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/merge-or-set/m-p/243938#M45417</link>
      <description>&lt;P&gt;I agree, manipulate this within the original macro to get the desired variable names.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2016 21:41:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/merge-or-set/m-p/243938#M45417</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2016-01-15T21:41:46Z</dc:date>
    </item>
  </channel>
</rss>

