<?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 to convert multiple obs to one ob per subject in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-multiple-obs-to-one-ob-per-subject/m-p/356562#M83617</link>
    <description>&lt;P&gt;That's a cleaver use of &lt;A href="http://support.sas.com/documentation/cdl/en/basess/68381/HTML/default/viewer.htm#p01espjvpdhfafn1u3h96ond462p.htm" target="_self"&gt;update&lt;/A&gt;. Thanks for the other method!&lt;/P&gt;</description>
    <pubDate>Fri, 05 May 2017 21:48:36 GMT</pubDate>
    <dc:creator>Urban_Science</dc:creator>
    <dc:date>2017-05-05T21:48:36Z</dc:date>
    <item>
      <title>how to convert multiple obs to one ob per subject</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-multiple-obs-to-one-ob-per-subject/m-p/356540#M83605</link>
      <description>&lt;P&gt;I tried self join but its not working.can anyone tell me how to convert it 1 obs per usubjid&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;obs usubjid wt wtu temp tempu&lt;/P&gt;&lt;P&gt;1 &amp;nbsp; &amp;nbsp; 100 &amp;nbsp; &amp;nbsp; &amp;nbsp;70 &amp;nbsp;kg&lt;/P&gt;&lt;P&gt;2 &amp;nbsp; &amp;nbsp; 100 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 34 &amp;nbsp; &amp;nbsp; &amp;nbsp; c&lt;/P&gt;&lt;P&gt;3 &amp;nbsp; &amp;nbsp; 101 &amp;nbsp; &amp;nbsp; &amp;nbsp;77 &amp;nbsp;kg&lt;/P&gt;&lt;P&gt;4 &amp;nbsp; &amp;nbsp; 101 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 30 &amp;nbsp; &amp;nbsp; &amp;nbsp; c&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 20:36:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-multiple-obs-to-one-ob-per-subject/m-p/356540#M83605</guid>
      <dc:creator>paddyb</dc:creator>
      <dc:date>2017-05-05T20:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert multiple obs to one ob per subject</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-multiple-obs-to-one-ob-per-subject/m-p/356549#M83607</link>
      <description>&lt;P&gt;I know you said you tried a self join, but using proc sql I think it should work. &amp;nbsp;The code would look something like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC SQL;
  CREATE TABLE WORK.EXAMPLE AS 
     SELECT A.usubjid
        , A.wt
        , A.wtu
        , B.temp
        , B.tempu
      FROM &amp;lt;table&amp;gt; AS A
      INNER JOIN &amp;lt;table&amp;gt; AS B
        ON A.usubjid = B.usubjid
      WHERE A.wt IS NOT NULL
        AND b.TEMP IS NOT NULL
      ;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;There might be prettier solutions, but this should get you on your way. &amp;nbsp;Good luck!&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 21:05:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-multiple-obs-to-one-ob-per-subject/m-p/356549#M83607</guid>
      <dc:creator>Urban_Science</dc:creator>
      <dc:date>2017-05-05T21:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert multiple obs to one ob per subject</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-multiple-obs-to-one-ob-per-subject/m-p/356550#M83608</link>
      <description>&lt;P&gt;In a datastep, just use the update statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data want;
  update have (obs=0) have;
   by usubjid;
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note: Modified to incorporate&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;'s correction&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 21:18:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-multiple-obs-to-one-ob-per-subject/m-p/356550#M83608</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-05-05T21:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert multiple obs to one ob per subject</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-multiple-obs-to-one-ob-per-subject/m-p/356552#M83610</link>
      <description>&lt;P&gt;Art's suggestion is a good approach (assuming your data set is sorted), but requires a slight modification:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;update have (obs=0) have;&lt;/P&gt;
&lt;P&gt;by usubjid;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 21:11:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-multiple-obs-to-one-ob-per-subject/m-p/356552#M83610</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-05-05T21:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert multiple obs to one ob per subject</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-multiple-obs-to-one-ob-per-subject/m-p/356554#M83612</link>
      <description>thanks</description>
      <pubDate>Fri, 05 May 2017 21:20:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-multiple-obs-to-one-ob-per-subject/m-p/356554#M83612</guid>
      <dc:creator>paddyb</dc:creator>
      <dc:date>2017-05-05T21:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert multiple obs to one ob per subject</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-multiple-obs-to-one-ob-per-subject/m-p/356562#M83617</link>
      <description>&lt;P&gt;That's a cleaver use of &lt;A href="http://support.sas.com/documentation/cdl/en/basess/68381/HTML/default/viewer.htm#p01espjvpdhfafn1u3h96ond462p.htm" target="_self"&gt;update&lt;/A&gt;. Thanks for the other method!&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 21:48:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-multiple-obs-to-one-ob-per-subject/m-p/356562#M83617</guid>
      <dc:creator>Urban_Science</dc:creator>
      <dc:date>2017-05-05T21:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to convert multiple obs to one ob per subject</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-convert-multiple-obs-to-one-ob-per-subject/m-p/356572#M83621</link>
      <description>&lt;P&gt;Thanks.Never thought using update its so easy:)&lt;/P&gt;</description>
      <pubDate>Sat, 06 May 2017 00:36:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-convert-multiple-obs-to-one-ob-per-subject/m-p/356572#M83621</guid>
      <dc:creator>paddyb</dc:creator>
      <dc:date>2017-05-06T00:36:46Z</dc:date>
    </item>
  </channel>
</rss>

