<?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: Take the top two scores in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Take-the-top-two-scores/m-p/620777#M19540</link>
    <description>&lt;P&gt;I assume that each observation is one person?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In that case, use the Largest function&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Note_A Note_B Note_C;
datalines;
10 12 14
16 14 8
15 16 12
;

data want;
    set have;
    Max_note_1 = max(of Note:);
    Max_note_2 = largest(2, of Note:);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 29 Jan 2020 09:29:43 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2020-01-29T09:29:43Z</dc:date>
    <item>
      <title>Take the top two scores</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Take-the-top-two-scores/m-p/620775#M19538</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table containing one satisfaction score on three criteria for several individuals.&lt;/P&gt;&lt;P&gt;My table is presented as follows :&lt;/P&gt;&lt;P&gt;Note_A / Note_B / Note_C&lt;/P&gt;&lt;P&gt;10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 12&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 14&lt;/P&gt;&lt;P&gt;16&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 14&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 8&lt;/P&gt;&lt;P&gt;15&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 16&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 12&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create two new columns "Max_note_1" and "Max_note_2" that&amp;nbsp;&lt;SPAN&gt;take the two highest scores for each person.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I do this ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance for your help !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2020 09:14:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Take-the-top-two-scores/m-p/620775#M19538</guid>
      <dc:creator>Mick_lb</dc:creator>
      <dc:date>2020-01-29T09:14:33Z</dc:date>
    </item>
    <item>
      <title>Re: Take the top two scores</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Take-the-top-two-scores/m-p/620776#M19539</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/303367"&gt;@Mick_lb&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the LARGEST() function that&amp;nbsp;&lt;SPAN&gt;returns the xth largest non-missing value.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;best,&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	input Note_A Note_B Note_C;
	datalines;
10 12 14
16 14 8
15 16 12
;
run;

data want;
	set have;
	Max_note_1 = largest(1, Note_A, Note_B, Note_C);
	Max_note_2 = largest(2, Note_A, Note_B, Note_C);
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Jan 2020 09:26:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Take-the-top-two-scores/m-p/620776#M19539</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-01-29T09:26:21Z</dc:date>
    </item>
    <item>
      <title>Re: Take the top two scores</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Take-the-top-two-scores/m-p/620777#M19540</link>
      <description>&lt;P&gt;I assume that each observation is one person?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In that case, use the Largest function&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input Note_A Note_B Note_C;
datalines;
10 12 14
16 14 8
15 16 12
;

data want;
    set have;
    Max_note_1 = max(of Note:);
    Max_note_2 = largest(2, of Note:);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Jan 2020 09:29:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Take-the-top-two-scores/m-p/620777#M19540</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-01-29T09:29:43Z</dc:date>
    </item>
  </channel>
</rss>

