<?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: Repeating values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Repeating-values/m-p/712504#M219681</link>
    <description>I think my solution works even if the StudyID has only one record, because that would still be the first record.</description>
    <pubDate>Tue, 19 Jan 2021 20:50:30 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2021-01-19T20:50:30Z</dc:date>
    <item>
      <title>Repeating values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Repeating-values/m-p/712499#M219677</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; I have multiple rows of patient data with a repeating ID, but the data contained within each row is different. The patient ID on top is the one I'd like to remove:&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;studyid &amp;nbsp; &amp;nbsp; age &amp;nbsp; &amp;nbsp;sex &amp;nbsp; &amp;nbsp; los &amp;nbsp; &amp;nbsp;cause of injury&lt;/P&gt;&lt;P&gt;2048 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 34 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;F &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3 &amp;nbsp; &amp;nbsp; &amp;nbsp; MVA&lt;/P&gt;&lt;P&gt;2048 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 33 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;F &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4 &amp;nbsp; &amp;nbsp; &amp;nbsp; MCC&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;studyid &amp;nbsp; &amp;nbsp; age &amp;nbsp; &amp;nbsp;sex &amp;nbsp; &amp;nbsp; los &amp;nbsp; &amp;nbsp;cause of injury&lt;/P&gt;&lt;P&gt;2048 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 33 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;F &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4 &amp;nbsp; &amp;nbsp; &amp;nbsp; MCC&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 20:39:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Repeating-values/m-p/712499#M219677</guid>
      <dc:creator>stancemcgraw</dc:creator>
      <dc:date>2021-01-19T20:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: Repeating values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Repeating-values/m-p/712501#M219678</link>
      <description>Is it always the first one?&lt;BR /&gt;&lt;BR /&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;by studyID;&lt;BR /&gt;if first.studyID;&lt;BR /&gt;run;&lt;BR /&gt;</description>
      <pubDate>Tue, 19 Jan 2021 20:42:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Repeating-values/m-p/712501#M219678</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-01-19T20:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: Repeating values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Repeating-values/m-p/712502#M219679</link>
      <description>&lt;P&gt;Agree with&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp; 's solution. I am making the assumption to account for a case where there's just one studyid record&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile cards truncover;
input (studyid     age    sex     los    causeofinjury) ($);
cards;
2048         34        F        3       MVA
2048         33        F        4       MCC
;

data want;
 set have;
 by studyid;
 if first.studyid and last.studyid or not first.studyid;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 20:44:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Repeating-values/m-p/712502#M219679</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2021-01-19T20:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: Repeating values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Repeating-values/m-p/712504#M219681</link>
      <description>I think my solution works even if the StudyID has only one record, because that would still be the first record.</description>
      <pubDate>Tue, 19 Jan 2021 20:50:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Repeating-values/m-p/712504#M219681</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-01-19T20:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: Repeating values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Repeating-values/m-p/712505#M219682</link>
      <description>&lt;P&gt;Oops&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp; the OP &lt;STRONG&gt;doesn't&lt;/STRONG&gt; want the 1st record. Am i mistaken?&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;"The patient ID on top is the one I'd like to &lt;STRONG&gt;remove:&lt;/STRONG&gt;"&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 20:53:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Repeating-values/m-p/712505#M219682</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2021-01-19T20:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: Repeating values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Repeating-values/m-p/712516#M219686</link>
      <description>You are correct, I read it wrong, it should be last.StudyID not first.StudyID.&lt;BR /&gt;If last.studyID would be the equivalent and works for all situations regardless of multiples or a single study ID.</description>
      <pubDate>Tue, 19 Jan 2021 21:20:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Repeating-values/m-p/712516#M219686</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-01-19T21:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: Repeating values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Repeating-values/m-p/712518#M219688</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp; Are you assuming all by groups to have only 2 records for last.studyid alone check?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 21:24:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Repeating-values/m-p/712518#M219688</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2021-01-19T21:24:52Z</dc:date>
    </item>
    <item>
      <title>Re: Repeating values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Repeating-values/m-p/712519#M219689</link>
      <description>I'm assuming that you'd only keep the last record. You're assuming that you only remove the first record. Given the data, I highly suspect it would make sense to only include the last record but only OP can clarify that issue.</description>
      <pubDate>Tue, 19 Jan 2021 21:27:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Repeating-values/m-p/712519#M219689</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-01-19T21:27:56Z</dc:date>
    </item>
  </channel>
</rss>

