DATA Step, Macro, Functions and more

Sorting a Hash Table

Reply
Occasional Contributor
Posts: 7

Sorting a Hash Table

Hi, does anybody know how to sort a hash table?

Thanks!

Super Contributor
Posts: 275

Re: Sorting a Hash Table

data _null_;
   if _n_=1 then do;
     if 0 then set sashelp.class;
     declare hash h(dataset:'sashelp.class',ordered:'y',multidata:'y');
	 h.definekey('weight');
	 h.definedata(all:'y');
	 h.definedone();
   end;
   rc=h.output(dataset:'want');
run;
Ask a Question
Discussion stats
  • 1 reply
  • 167 views
  • 0 likes
  • 2 in conversation