<?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: How do I condition on a different observation? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-condition-on-a-different-observation/m-p/669598#M200894</link>
    <description>&lt;P&gt;I will say congratulations on thinking to check on such things.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However if your data looks like some of mine do not be surprised if one or more of the status point to someone in a different house, assuming the PNUM is unique across households and not assigned within household.&lt;/P&gt;</description>
    <pubDate>Wed, 15 Jul 2020 17:14:29 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-07-15T17:14:29Z</dc:date>
    <item>
      <title>How do I condition on a different observation?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-condition-on-a-different-observation/m-p/669558#M200874</link>
      <description>&lt;P&gt;I'm examining a dataset where everyone within the same household has the same ID, but different person numbers (PNUM).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;They also have marital status pointers that point to PNUMs of their spouses.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to check if a persons spouse has some other condition.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What's the best way of going about this?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 16:08:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-condition-on-a-different-observation/m-p/669558#M200874</guid>
      <dc:creator>mikeed</dc:creator>
      <dc:date>2020-07-15T16:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do I condition on a different observation?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-condition-on-a-different-observation/m-p/669560#M200876</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table want as
select t1.*, t2.condition as spouse_condition
from have as t1
left join have as t2
on t1.spouse_num = t2.num;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;A self join/merge is what you want. Merge the data on the Spouses ID and then pull through the condition variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/204413"&gt;@mikeed&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm examining a dataset where everyone within the same household has the same ID, but different person numbers (PNUM).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;They also have marital status pointers that point to PNUMs of their spouses.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to check if a persons spouse has some other condition.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What's the best way of going about this?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 16:13:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-condition-on-a-different-observation/m-p/669560#M200876</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-07-15T16:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do I condition on a different observation?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-condition-on-a-different-observation/m-p/669598#M200894</link>
      <description>&lt;P&gt;I will say congratulations on thinking to check on such things.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However if your data looks like some of mine do not be surprised if one or more of the status point to someone in a different house, assuming the PNUM is unique across households and not assigned within household.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 17:14:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-condition-on-a-different-observation/m-p/669598#M200894</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-07-15T17:14:29Z</dc:date>
    </item>
  </channel>
</rss>

