<?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 create hash object descending order and output question in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/how-do-I-create-hash-object-descending-order-and-output-question/m-p/615848#M18826</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/295663"&gt;@shawn123&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The item included in KEY part is used for Sorting. Score is your Key. Therefore you are right.&lt;/P&gt;
&lt;P&gt;The second is due to spelling error in&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;socre&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Correct it and you will get what you want.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 08 Jan 2020 03:46:26 GMT</pubDate>
    <dc:creator>KachiM</dc:creator>
    <dc:date>2020-01-08T03:46:26Z</dc:date>
    <item>
      <title>how do I create hash object descending order and output question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-do-I-create-hash-object-descending-order-and-output-question/m-p/615839#M18825</link>
      <description>&lt;P&gt;Hello guys. I have two questions regarding my code. The first one is the descending order inside the declare hash statement, which value will be applied to the descending order? I read material online, some people said the order would be applied on all the keys, so in my case, will the order only applied to the "score" variable?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another question is my code output nothing on the ge90 dataset. But I don't understand the reason? Thanks in advance!&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data class_scores;
 input name :$9. score @@;
datalines;
Callum 82 Chyou 92
Damien 89 Grace 74
Jorge 99 Kyle 85
Lachlan 83 Lucia 90
Mia 91 Niamh 80
Philipp 89 Tomas 76
;
data top_quarter bottom_quarter ge90;
 length name $9 score 8;
 keep name score;
 if _n_=1 then do;
 declare hash h(dataset: 'class_scores', ordered: 'descending');
 h.defineKey('score');
 h.defineData('score','name');
 h.defineDone();
 call missing(name, score); 
 declare hiter hi('h');
 end;

 count=h.num_items;
 n=4;
 put count=;
 hi.first();
 do i=1 to n;
 output top_quarter;
 hi.next();
 end;
 hi.last();
 do i=1 to n;
 output bottom_quarter;
 hi.prev();
 end;
rc=hi.first();
do while(rc=0);
if socre&amp;gt;90 then output ge90;
rc=hi.next();
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2020 02:06:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-do-I-create-hash-object-descending-order-and-output-question/m-p/615839#M18825</guid>
      <dc:creator>shawn123</dc:creator>
      <dc:date>2020-01-08T02:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: how do I create hash object descending order and output question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-do-I-create-hash-object-descending-order-and-output-question/m-p/615848#M18826</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/295663"&gt;@shawn123&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The item included in KEY part is used for Sorting. Score is your Key. Therefore you are right.&lt;/P&gt;
&lt;P&gt;The second is due to spelling error in&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;socre&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Correct it and you will get what you want.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2020 03:46:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-do-I-create-hash-object-descending-order-and-output-question/m-p/615848#M18826</guid>
      <dc:creator>KachiM</dc:creator>
      <dc:date>2020-01-08T03:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: how do I create hash object descending order and output question</title>
      <link>https://communities.sas.com/t5/New-SAS-User/how-do-I-create-hash-object-descending-order-and-output-question/m-p/615849#M18827</link>
      <description>Thank you so much!</description>
      <pubDate>Wed, 08 Jan 2020 03:48:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/how-do-I-create-hash-object-descending-order-and-output-question/m-p/615849#M18827</guid>
      <dc:creator>shawn123</dc:creator>
      <dc:date>2020-01-08T03:48:44Z</dc:date>
    </item>
  </channel>
</rss>

