<?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: Match Columns data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Match-Columns-data/m-p/203008#M37846</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply. The code is giving incorrect results. Answer to your question - Actually i have missing observations for those columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;below my second table.. first row 3rd column id "a" missing it occupied by id "b"&amp;nbsp; like that i have the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="border: 0px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;TBODY style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD height="20" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="64"&gt;id1&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="64"&gt;val1&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="64"&gt;id2&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="64"&gt;val2&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="64"&gt;id3&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="64"&gt;val3&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD height="20" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;a&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;200&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;b&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;10&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;a&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;20.22&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD height="20" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;b&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;300&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;c&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;30&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;c&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;2.12&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD height="20" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;c&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;400&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;d&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;20&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD height="20" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;d&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;100&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Aug 2015 19:08:11 GMT</pubDate>
    <dc:creator>kumarK</dc:creator>
    <dc:date>2015-08-19T19:08:11Z</dc:date>
    <item>
      <title>Match Columns data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-Columns-data/m-p/203003#M37841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two data sets like this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data t1;&lt;/P&gt;&lt;P&gt;input id$;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;a&lt;/P&gt;&lt;P&gt;b&lt;/P&gt;&lt;P&gt;c&lt;/P&gt;&lt;P&gt;d&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have second table has 100 of columns like below: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 384px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" width="64"&gt;id1&lt;/TD&gt;&lt;TD width="64"&gt;val1&lt;/TD&gt;&lt;TD width="64"&gt;id2&lt;/TD&gt;&lt;TD width="64"&gt;val2&lt;/TD&gt;&lt;TD width="64"&gt;id3&lt;/TD&gt;&lt;TD width="64"&gt;val3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;a&lt;/TD&gt;&lt;TD align="right"&gt;200&lt;/TD&gt;&lt;TD&gt;b&lt;/TD&gt;&lt;TD align="right"&gt;10&lt;/TD&gt;&lt;TD&gt;a&lt;/TD&gt;&lt;TD align="right"&gt;20.22&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;b&lt;/TD&gt;&lt;TD align="right"&gt;300&lt;/TD&gt;&lt;TD&gt;c&lt;/TD&gt;&lt;TD align="right"&gt;30&lt;/TD&gt;&lt;TD&gt;c&lt;/TD&gt;&lt;TD align="right"&gt;2.12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;c&lt;/TD&gt;&lt;TD align="right"&gt;400&lt;/TD&gt;&lt;TD&gt;d&lt;/TD&gt;&lt;TD align="right"&gt;20&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;d&lt;/TD&gt;&lt;TD align="right"&gt;100&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want output like below All the id's of "a" values in one row and all the id's of&amp;nbsp; "b" values in another row like that: &lt;STRONG&gt;Please help me the code in SQL so that i can tweak as per requirement.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="640"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" width="64"&gt;id&lt;/TD&gt;&lt;TD width="64"&gt;val1&lt;/TD&gt;&lt;TD width="64"&gt;val2&lt;/TD&gt;&lt;TD width="64"&gt;val3&lt;/TD&gt;&lt;TD width="64"&gt;val4&lt;/TD&gt;&lt;TD width="64"&gt;val5&lt;/TD&gt;&lt;TD width="64"&gt;val6&lt;/TD&gt;&lt;TD width="64"&gt;val7&lt;/TD&gt;&lt;TD width="64"&gt;val8&lt;/TD&gt;&lt;TD width="64"&gt;val9&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD height="20"&gt;a&lt;/TD&gt;&lt;TD align="right"&gt;200&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;TD align="right"&gt;20.22&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD height="20"&gt;b&lt;/TD&gt;&lt;TD align="right"&gt;300&lt;/TD&gt;&lt;TD align="right"&gt;10&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD height="20"&gt;c&lt;/TD&gt;&lt;TD align="right"&gt;400&lt;/TD&gt;&lt;TD align="right"&gt;30&lt;/TD&gt;&lt;TD align="right"&gt;2.12&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD height="20"&gt;d&lt;/TD&gt;&lt;TD align="right"&gt;100&lt;/TD&gt;&lt;TD align="right"&gt;20&lt;/TD&gt;&lt;TD&gt;.&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks alot...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 18:29:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-Columns-data/m-p/203003#M37841</guid>
      <dc:creator>kumarK</dc:creator>
      <dc:date>2015-08-19T18:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: Match Columns data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-Columns-data/m-p/203004#M37842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you explain what you want, in words?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 18:38:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-Columns-data/m-p/203004#M37842</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-08-19T18:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: Match Columns data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-Columns-data/m-p/203005#M37843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think this is what you want but what you have as your output doesn't match what this code will do.&amp;nbsp; If my output is wrong please explain why you have a blank for val2 in row 1 and 10 for val2 in row 2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select &lt;/P&gt;&lt;P&gt;a.*,&lt;/P&gt;&lt;P&gt;b.val1,&lt;/P&gt;&lt;P&gt;b.val2,&lt;/P&gt;&lt;P&gt;b.val3&lt;/P&gt;&lt;P&gt;from t1 a left join&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t2 b on&lt;/P&gt;&lt;P&gt;a.id = b.id1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 18:46:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-Columns-data/m-p/203005#M37843</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-08-19T18:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: Match Columns data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-Columns-data/m-p/203006#M37844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Homework? Please show us what you have tried, or at least some thoughts? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 18:56:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-Columns-data/m-p/203006#M37844</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2015-08-19T18:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: Match Columns data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-Columns-data/m-p/203007#M37845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want id wise observations , in output data set i want for id "a" row only i want "a" observations, for id "b" row i want "b" observations like that.. if there any missing values simply put null in those columns..i hope you understand the question.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 19:02:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-Columns-data/m-p/203007#M37845</guid>
      <dc:creator>kumarK</dc:creator>
      <dc:date>2015-08-19T19:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: Match Columns data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-Columns-data/m-p/203008#M37846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply. The code is giving incorrect results. Answer to your question - Actually i have missing observations for those columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;below my second table.. first row 3rd column id "a" missing it occupied by id "b"&amp;nbsp; like that i have the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="border: 0px; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;TBODY style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD height="20" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="64"&gt;id1&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="64"&gt;val1&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="64"&gt;id2&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="64"&gt;val2&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="64"&gt;id3&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="64"&gt;val3&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD height="20" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;a&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;200&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;b&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;10&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;a&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;20.22&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD height="20" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;b&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;300&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;c&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;30&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;c&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;2.12&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD height="20" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;c&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;400&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;d&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;20&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;TD height="20" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;d&lt;/TD&gt;&lt;TD align="right" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;100&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 19:08:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-Columns-data/m-p/203008#M37846</guid>
      <dc:creator>kumarK</dc:creator>
      <dc:date>2015-08-19T19:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: Match Columns data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-Columns-data/m-p/203009#M37847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://communities.sas.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt; Not homework.. I have faced this scenario in my work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i thought first arrays then i thought some match merging but no idea how to proceed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 19:10:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-Columns-data/m-p/203009#M37847</guid>
      <dc:creator>kumarK</dc:creator>
      <dc:date>2015-08-19T19:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: Match Columns data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-Columns-data/m-p/203010#M37848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then why it has to be SQL?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason I asked this is that , Even though it can done using data step, but SQL is obviously the text book answer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 19:34:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-Columns-data/m-p/203010#M37848</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2015-08-19T19:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: Match Columns data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-Columns-data/m-p/203011#M37849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That was my question too, if you have tried arrays why does it need to be in sql?&amp;nbsp; I'm curious to see another solution, but here is one.&amp;nbsp; Doesn't look that good to me but it gets the results:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data t1;&lt;/P&gt;&lt;P&gt;input id$;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;a&lt;/P&gt;&lt;P&gt;b&lt;/P&gt;&lt;P&gt;c&lt;/P&gt;&lt;P&gt;d&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data t2;&lt;/P&gt;&lt;P&gt;infile cards missover;&lt;/P&gt;&lt;P&gt;input id1$ val1&amp;nbsp; id2$ val2 id3$ val3;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;a 200&amp;nbsp;&amp;nbsp; b&amp;nbsp;&amp;nbsp; 10&amp;nbsp;&amp;nbsp; a&amp;nbsp;&amp;nbsp; 20.22&lt;/P&gt;&lt;P&gt;b 300&amp;nbsp;&amp;nbsp; c&amp;nbsp;&amp;nbsp; 30&amp;nbsp;&amp;nbsp; c&amp;nbsp;&amp;nbsp;&amp;nbsp; 2.12&lt;/P&gt;&lt;P&gt;c 400&amp;nbsp;&amp;nbsp; d&amp;nbsp;&amp;nbsp; 20&lt;/P&gt;&lt;P&gt;d 100&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table one as&lt;/P&gt;&lt;P&gt;select a.id,b.val1&lt;/P&gt;&lt;P&gt;from t1 a left join&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t2 b on&lt;/P&gt;&lt;P&gt;a.id = b.id1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;create table two as&lt;/P&gt;&lt;P&gt;select a.*,b.val2&lt;/P&gt;&lt;P&gt;from one a left join&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t2 b on&lt;/P&gt;&lt;P&gt;a.id = b.id2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;create table want as&lt;/P&gt;&lt;P&gt;select a.*,b.val3&lt;/P&gt;&lt;P&gt;from two a left join&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t2 b on&lt;/P&gt;&lt;P&gt;a.id = b.id3;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 19:36:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-Columns-data/m-p/203011#M37849</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-08-19T19:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: Match Columns data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-Columns-data/m-p/203012#M37850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the simplest solution would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;a.id1, a.val1, b.val2 as val2, c.val3 as val3&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;from &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; t2 as a left join&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; t2 as b on a.id1=b.id2 left join&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; t2 as c on a.id1=c.id3;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 22:17:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-Columns-data/m-p/203012#M37850</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-08-19T22:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: Match Columns data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-Columns-data/m-p/203013#M37851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The reason is, i have to run some codes on the SQL Server.&amp;nbsp; if i get an idea about the logic then i can tweak as per my requirement. Thanks lot for suggestions.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2015 04:42:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-Columns-data/m-p/203013#M37851</guid>
      <dc:creator>kumarK</dc:creator>
      <dc:date>2015-08-20T04:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: Match Columns data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-Columns-data/m-p/203014#M37852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks PGStats. It is very helpful for some columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually i have lots of columns, so i have to mention all the column names kn the code, is there any other way to do it similar..? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2015 17:49:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-Columns-data/m-p/203014#M37852</guid>
      <dc:creator>kumarK</dc:creator>
      <dc:date>2015-08-20T17:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Match Columns data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-Columns-data/m-p/203015#M37853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Mark.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As i edited my question please have a look, the code you given is for some columns, i have many columns, Is there any other way?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2015 17:51:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-Columns-data/m-p/203015#M37853</guid>
      <dc:creator>kumarK</dc:creator>
      <dc:date>2015-08-20T17:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: Match Columns data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Match-Columns-data/m-p/203016#M37854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If those extra columns are not involved in the reshaping issue, you could do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;a.*, b.val2 as newVal2, c.val3 as newVal3&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;from &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; t2 as a left join&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; t2 as b on a.id1=b.id2 left join&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; t2 as c on a.id1=c.id3;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;otherwise, &lt;STRONG&gt;yes&lt;/STRONG&gt;, you have to do some extra typing. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&amp;nbsp; ... or... start a new discussion about solving this with macro programming. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Aug 2015 18:21:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Match-Columns-data/m-p/203016#M37854</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-08-20T18:21:29Z</dc:date>
    </item>
  </channel>
</rss>

