<?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 Reg:Sorting Data by Hash Keys in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Sorting-Data-by-Hash-Keys/m-p/18595#M3689</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom,&amp;nbsp; I can't answer why the OP would want to do this, but I can answer what the number represents: 1.2 million.&amp;nbsp; See: &lt;A href="http://en.wikipedia.org/wiki/Lakh"&gt;http://en.wikipedia.org/wiki/Lakh&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Sep 2011 14:00:18 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2011-09-29T14:00:18Z</dc:date>
    <item>
      <title>Reg:Sorting Data by Hash Keys</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Sorting-Data-by-Hash-Keys/m-p/18588#M3682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;HI i having a dataset with 72 variables and having 12lacs observation&lt;BR /&gt;i want to sort the data on two variables but do reduce the time i want to do it by hash hey &lt;BR /&gt;how can i do it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=temp;&lt;BR /&gt;by name date;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2011 06:47:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reg-Sorting-Data-by-Hash-Keys/m-p/18588#M3682</guid>
      <dc:creator>My_SAS</dc:creator>
      <dc:date>2011-09-28T06:47:43Z</dc:date>
    </item>
    <item>
      <title>Reg:Sorting Data by Hash Keys</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Sorting-Data-by-Hash-Keys/m-p/18589#M3683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you confusing a hash join with a type of sort?&amp;nbsp; Are you wanting to create a new key as a hash value of the concatenation of the name and date fields?&amp;nbsp; Or something else? A sort of a file with only 72 variables and 1,200,000 observations should be very quick already...&amp;nbsp; What kind of system are you using?&amp;nbsp; You could try using the tagsort option.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2011 16:02:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reg-Sorting-Data-by-Hash-Keys/m-p/18589#M3683</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-09-28T16:02:55Z</dc:date>
    </item>
    <item>
      <title>Reg:Sorting Data by Hash Keys</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Sorting-Data-by-Hash-Keys/m-p/18590#M3684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you just talking about the TAGSORT option on PROC SORT?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a000146878.htm"&gt;http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a000146878.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2011 16:12:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reg-Sorting-Data-by-Hash-Keys/m-p/18590#M3684</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-09-28T16:12:47Z</dc:date>
    </item>
    <item>
      <title>Reg:Sorting Data by Hash Keys</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Sorting-Data-by-Hash-Keys/m-p/18591#M3685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is a balance in the performance offered by tagsorting.&amp;nbsp; If you use the tagsort option you remove the ability for the sort to be multithreaded.&amp;nbsp; So if your performance is hindered by I/O avaiablility for your utility files from the sort, then tagsort is a good option.&amp;nbsp; If you are not bounded by I/O or disk space for these files then you will likely see hindered sort performance.&amp;nbsp; You could try allocating additional memory to the sort procedure (see the sortsize option and other options in the memory/performace groups).&amp;nbsp; On my system, with default memory options a table with 4,000 columns and 1,000,000 obs took about 5 minutes with a lot of system competition.&amp;nbsp; However if I run the same sort with the tagsort option on it took over 10 minutes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2011 18:54:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reg-Sorting-Data-by-Hash-Keys/m-p/18591#M3685</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-09-28T18:54:04Z</dc:date>
    </item>
    <item>
      <title>Reg:Sorting Data by Hash Keys</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Sorting-Data-by-Hash-Keys/m-p/18592#M3686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You only need to use argument ordered: 'a' in hash table constructor.&lt;/P&gt;&lt;P&gt;and put these name into definekey () .Hash will automatically sort them for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;declare hash ha1(dataset:'temp',ordered: 'a');&lt;/P&gt;&lt;P&gt;&amp;nbsp; ha1.definekey('name','age');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Sep 2011 08:35:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reg-Sorting-Data-by-Hash-Keys/m-p/18592#M3686</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-09-29T08:35:57Z</dc:date>
    </item>
    <item>
      <title>Reg:Sorting Data by Hash Keys</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Sorting-Data-by-Hash-Keys/m-p/18593#M3687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data temp;&lt;/P&gt;&lt;P&gt;input name age;&lt;/P&gt;&lt;P&gt;declare hash ha1(dataset:'temp',ordered: 'a');&lt;/P&gt;&lt;P&gt;&amp;nbsp; ha1.definekey('name','age');&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;23 45&lt;/P&gt;&lt;P&gt;67 89&lt;/P&gt;&lt;P&gt;12 56&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc print;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tryed this but it did not worked how can i do it and how can i use the hash key in proc sort:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=temp;&lt;/P&gt;&lt;P&gt;by ha1.definekey;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i have used this iam getting error. can any one help me&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Sep 2011 12:58:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reg-Sorting-Data-by-Hash-Keys/m-p/18593#M3687</guid>
      <dc:creator>My_SAS</dc:creator>
      <dc:date>2011-09-29T12:58:51Z</dc:date>
    </item>
    <item>
      <title>Reg:Sorting Data by Hash Keys</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Sorting-Data-by-Hash-Keys/m-p/18594#M3688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am really not clear on what you mean by "use the hash key" in proc sort. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why do you want to sort your data?&lt;/P&gt;&lt;P&gt;Would an index serve your needs?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Also how large is your dataset? What number does 12lacs represent?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Sep 2011 13:55:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reg-Sorting-Data-by-Hash-Keys/m-p/18594#M3688</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2011-09-29T13:55:15Z</dc:date>
    </item>
    <item>
      <title>Reg:Sorting Data by Hash Keys</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Sorting-Data-by-Hash-Keys/m-p/18595#M3689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom,&amp;nbsp; I can't answer why the OP would want to do this, but I can answer what the number represents: 1.2 million.&amp;nbsp; See: &lt;A href="http://en.wikipedia.org/wiki/Lakh"&gt;http://en.wikipedia.org/wiki/Lakh&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Sep 2011 14:00:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reg-Sorting-Data-by-Hash-Keys/m-p/18595#M3689</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-09-29T14:00:18Z</dc:date>
    </item>
    <item>
      <title>Reg:Sorting Data by Hash Keys</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Sorting-Data-by-Hash-Keys/m-p/18596#M3690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good thinking Ksharp, I do believe this is the method the OP was trying to ask about utilizing.&amp;nbsp; However, I do not think he understands it's use or implementation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Sep 2011 14:56:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reg-Sorting-Data-by-Hash-Keys/m-p/18596#M3690</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-09-29T14:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: Reg:Sorting Data by Hash Keys</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Sorting-Data-by-Hash-Keys/m-p/18597#M3691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You do not use Hash Table correctly.&lt;/P&gt;&lt;P&gt;See the followig code of example.&lt;/P&gt;&lt;P&gt;BTW. I am not sure this method will be more efficient than proc sort;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data temp;
input name age;
cards;
23 45
67 89
12 56
;
run;
data _null_;
*load dataset temp into Hash Table;
if 0 then set temp;
declare hash ha1(dataset:'temp',ordered: 'a');
&amp;nbsp; ha1.definekey('name','age');
&amp;nbsp; ha1.definedata('name','age');
&amp;nbsp; ha1.definedone();
*output Hash Table to a dataset;
&amp;nbsp; ha1.output(dataset:'want');
run;
*now see the data has already been sort by name age;
proc print data=want;run;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Sep 2011 06:01:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reg-Sorting-Data-by-Hash-Keys/m-p/18597#M3691</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-09-30T06:01:05Z</dc:date>
    </item>
  </channel>
</rss>

