<?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: Select specific record in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Select-specific-record/m-p/734190#M228751</link>
    <description>&lt;P&gt;---I would like to get smaller(K6 or K9) one if there are two categories for a PID.&lt;BR /&gt;In case only one PID then I would like to get that record irrespective of the category.&lt;BR /&gt;&lt;BR /&gt;End result- WANT dataset should have one record per PID( lowest category) and with all the non missing data for val1 and val2.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Apr 2021 13:45:51 GMT</pubDate>
    <dc:creator>Stalk</dc:creator>
    <dc:date>2021-04-16T13:45:51Z</dc:date>
    <item>
      <title>Select specific record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-specific-record/m-p/734003#M228708</link>
      <description>&lt;P&gt;In my raw dataset I have PID that belong to one or 2 categories. K9 or K12 and K6 or K12 or just K12 or I would like to get the following records (want) when category is in K6 or K9 if there are no other records for the PID. If there is only one PID and if it is K12 category then I would like to get that only record.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One other important thing is I need to get only one record per PID. But before that I would like to get Val1 and Val2 id they exist for PID.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data temp_copy;&lt;/P&gt;
&lt;P&gt;infile cards dlm='|' truncover ;&lt;/P&gt;
&lt;P&gt;input subDate :mmddyy10. PID :$5. AID :$2. CurrentDept :$2. val1 :$5. val2 :$5. Category $4.;&lt;/P&gt;
&lt;P&gt;format subDate yymmdd10.;&lt;/P&gt;
&lt;P&gt;cards;&lt;BR /&gt;01/08/2021|29545|54|99|-|-|K12&lt;BR /&gt;01/08/2021|29545|54|99|-|P3.1|K6&lt;BR /&gt;01/08/2021|29545|54|99|P2.4|-|K6&lt;BR /&gt;01/11/2021|56545|45|99|P5.4|-|K12&lt;BR /&gt;01/09/2021|56545|45|99|-|-|K6&lt;BR /&gt;02/08/2021|56546|45|88|-|-|K12&lt;BR /&gt;02/08/2021|49545|33|99|P5.4|-|K6&lt;BR /&gt;12/21/2020|99546|56|94|-|-|K9&lt;BR /&gt;01/27/2021|99546|56|94|P7.4|-|K12&lt;BR /&gt;01/27/2021|99546|56|99|-|6.1|K9&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;Want...&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;29545 -01/08/2021|29545|54|99|P2.4|P3.1|K6&lt;BR /&gt;56545 -01/11/2021|56545|45|99|P5.4|-|K6&lt;BR /&gt;56546 -02/08/2021|56546|45|88|-|-|K12&lt;BR /&gt;49545 -02/08/2021|49545|33|99|P5.4|-|K6&lt;BR /&gt;99546 -01/27/2021|99546|56|99|P7.4|6.1|K9&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 15 Apr 2021 01:08:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-specific-record/m-p/734003#M228708</guid>
      <dc:creator>Stalk</dc:creator>
      <dc:date>2021-04-15T01:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: Select specific record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-specific-record/m-p/734034#M228716</link>
      <description>&lt;P&gt;If you have more than one category (K6 and K12, or K9 and K12), which data do you want to get?&lt;/P&gt;
&lt;P&gt;The last one? The larger one? The smaller one?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, what happens if you have one PID and the value of the category is not K12?&lt;/P&gt;
&lt;P&gt;In your example, I think PID=49545 would be the case, but it is included in the want.&lt;BR /&gt;The way you wrote it, "If there is only one PID and if it is K12 category then I would like to get that only record", because it reads as not including it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Apr 2021 02:36:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-specific-record/m-p/734034#M228716</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-04-15T02:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: Select specific record</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Select-specific-record/m-p/734190#M228751</link>
      <description>&lt;P&gt;---I would like to get smaller(K6 or K9) one if there are two categories for a PID.&lt;BR /&gt;In case only one PID then I would like to get that record irrespective of the category.&lt;BR /&gt;&lt;BR /&gt;End result- WANT dataset should have one record per PID( lowest category) and with all the non missing data for val1 and val2.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Apr 2021 13:45:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Select-specific-record/m-p/734190#M228751</guid>
      <dc:creator>Stalk</dc:creator>
      <dc:date>2021-04-16T13:45:51Z</dc:date>
    </item>
  </channel>
</rss>

