<?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: Observation Join in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Observation-Join/m-p/108573#M22588</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank You!!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Oct 2013 18:41:48 GMT</pubDate>
    <dc:creator>Jsendzik</dc:creator>
    <dc:date>2013-10-09T18:41:48Z</dc:date>
    <item>
      <title>Observation Join</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Observation-Join/m-p/108568#M22583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure how to solve this problem and was wondering if yall could help me out. I have two tables &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table A: &lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Student&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Column1&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Column2&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Column3&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Coef1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Coef4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Coef5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Coef3&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;.&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;C&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Coef2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;Coef4&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table B: &lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" style="border: 1px solid rgb(0, 0, 0); width: 100%;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Student&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Coef1&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG style="color: #ffffff; text-align: center;"&gt;Coef2&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG style="color: #ffffff; text-align: center;"&gt;Coef3&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG style="color: #ffffff; text-align: center;"&gt;Coef4&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG style="color: #ffffff; text-align: center;"&gt;Coef5&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;P&gt;A&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;16&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;25&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;15&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;C&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;17&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;15&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;16&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to take the observation's in table A and somehow return the observations from table b. I can't think of a way to join this. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Oct 2013 17:59:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Observation-Join/m-p/108568#M22583</guid>
      <dc:creator>Jsendzik</dc:creator>
      <dc:date>2013-10-09T17:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: Observation Join</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Observation-Join/m-p/108569#M22584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you trying to say that for student A you'd like to keep Coef1, Coef4, and Coef5&amp;nbsp;&amp;nbsp; but for student B you'd only like to Keep Coef3, for c etc....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If so, how do you want your outputs?&amp;nbsp; Theoritically you already have your output in your secondary table if you want it to all be in one table. Did you want a different table for each student?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think a tiny bit more clarification would help!&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Brandon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Oct 2013 18:15:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Observation-Join/m-p/108569#M22584</guid>
      <dc:creator>Anotherdream</dc:creator>
      <dc:date>2013-10-09T18:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: Observation Join</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Observation-Join/m-p/108570#M22585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Magic would be required. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is absolutely nothing about Table A that shows where the numbers in Table B come from.&amp;nbsp; Perhaps you know more about the problem than you are telling us.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or perhaps you already have both tables and would like to generate something else as your final output.&amp;nbsp; What would that look like??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Oct 2013 18:17:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Observation-Join/m-p/108570#M22585</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2013-10-09T18:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: Observation Join</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Observation-Join/m-p/108571#M22586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With proc transpose:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data table_A;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;input Student $ Column1 $ Column2 $ Column3 $;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;datalines;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;A Coef1 Coef4 Coef5 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;B Coef3 . . &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;C Coef2 Coef4 . &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data Table_B;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;input Student $ Coef1 Coef2 Coef3 Coef4 Coef5;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;datalines;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;A 16 0 0 0 25 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;B 0 15 0 0 0 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;C 0 17 15 0 16 &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc transpose data=table_a out=ta;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;by student;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;var column:;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc transpose data=table_b out=tb;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;by student;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;var coef:;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;create table table_c as&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;select &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ta.student,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ta.COL1 as coef,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tb.COL1 as value&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;from &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ta inner join &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t&lt;/STRONG&gt;&lt;STRONG&gt;b on ta.student=tb.student and ta.COL1=tb._NAME_&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;order by student, coef;&lt;/STRONG&gt;&lt;BR /&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, 09 Oct 2013 18:28:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Observation-Join/m-p/108571#M22586</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-10-09T18:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: Observation Join</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Observation-Join/m-p/108572#M22587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree with the magic concept, but what I'm looking to do is not dependent on the values in table B. It's essentially a check to see if they even exist in the table.&lt;/P&gt;&lt;P&gt;Student B is the easiest scenario for me to try and explain. &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;In table A I'm perform a 'QA' on student B and it's been decided that they do not have Coef3. Table B is a historical record for all Coef's student B has had. If we see it in table A and it also exists as a &amp;gt;0 value in Table B then my 'QA' must have been wrong. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Hope this helps.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Oct 2013 18:29:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Observation-Join/m-p/108572#M22587</guid>
      <dc:creator>Jsendzik</dc:creator>
      <dc:date>2013-10-09T18:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Observation Join</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Observation-Join/m-p/108573#M22588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank You!!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Oct 2013 18:41:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Observation-Join/m-p/108573#M22588</guid>
      <dc:creator>Jsendzik</dc:creator>
      <dc:date>2013-10-09T18:41:48Z</dc:date>
    </item>
  </channel>
</rss>

