<?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: PUZZLE - finding anagram groups in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PUZZLE-finding-anagram-groups/m-p/77697#M16847</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"Through data-step java objects you could accomplish the inverse as well."&lt;/P&gt;&lt;P&gt;Unfortunately, data-step java interface is only supported by several primitive type object ,such as int string double float ..........., he can't return all of immense object from JAVA like DATE ,SWING .............&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Aug 2012 04:57:46 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2012-08-14T04:57:46Z</dc:date>
    <item>
      <title>PUZZLE - finding anagram groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUZZLE-finding-anagram-groups/m-p/77686#M16836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since I saw FriedEgg post a question at this forum ,which stimulate me to post another puzzle.&lt;/P&gt;&lt;P&gt;It is from JAVA Tutorials ( HashMap ), which is very interesting problem.&lt;/P&gt;&lt;P&gt;I can code it by using SAS ,but I will not code it for the sake of my little spare time. And I believe someone here can give some answer.&lt;/P&gt;&lt;P&gt;I will not mark someone' answer be correct too, I have given the answer at following . &lt;STRONG&gt;DON'T CHEAT&lt;/STRONG&gt; . &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;What we should learned is algorithm from Java code.&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;There is a standard trick for finding anagram groups: For each word in the dictionary, alphabetize the letters in the word (that is, reorder the word's letters into alphabetical order) and put an entry into a multimap, mapping the alphabetized word to the original word. For example, the word &lt;EM&gt;bad&lt;/EM&gt; causes an entry mapping &lt;EM&gt;abd&lt;/EM&gt; into &lt;EM&gt;bad&lt;/EM&gt; to be put into the multimap. A moment's reflection will show that all the words to which any given key maps form an anagram group. It's a simple matter to iterate over the keys in the multimap, printing out each anagram group that meets the size constraint.&lt;/P&gt;&lt;P&gt;&lt;A class="SourceLink" target="_blank"&gt;&lt;CODE&gt;The following program&lt;/CODE&gt;&lt;/A&gt; is a straightforward implementation of this technique.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;import java.util.*;
import java.io.*;

public class Anagrams {
&amp;nbsp;&amp;nbsp;&amp;nbsp; public static void main(String[] args) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int minGroupSize = Integer.parseInt(args[1]);

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Read words from file and put into a simulated multimap
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Map&amp;gt; m = new HashMap&amp;gt;();

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Scanner s = new Scanner(new File(args[0]));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (s.hasNext()) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String word = s.next();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String alpha = alphabetize(word);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; List l = m.get(alpha);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (l == null)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m.put(alpha, l=new ArrayList());
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; l.add(word);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (IOException e) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.err.println(e);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.exit(1);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Print all permutation groups above size threshold
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (List l : m.values())
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (l.size() &amp;gt;= minGroupSize)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(l.size() + ": " + l);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }

&amp;nbsp;&amp;nbsp;&amp;nbsp; private static String alphabetize(String s) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; char[] a = s.toCharArray();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Arrays.sort(a);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return new String(a);
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Running this program on a 173,000-word dictionary file with a minimum anagram group size of eight produces the following output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;9: [estrin, inerts, insert, inters, niters, nitres, sinter,&lt;/P&gt;&lt;P&gt;&amp;nbsp; triens, trines]&lt;/P&gt;&lt;P&gt;8: [lapse, leaps, pales, peals, pleas, salep, sepal, spale]&lt;/P&gt;&lt;P&gt;8: [aspers, parses, passer, prases, repass, spares, sparse,&lt;/P&gt;&lt;P&gt;&amp;nbsp; spears]&lt;/P&gt;&lt;P&gt;10: [least, setal, slate, stale, steal, stela, taels, tales,&lt;/P&gt;&lt;P&gt;&amp;nbsp; teals, tesla]&lt;/P&gt;&lt;P&gt;8: [enters, nester, renest, rentes, resent, tenser, ternes,&lt;/P&gt;&lt;P&gt;&amp;nbsp; treens]&lt;/P&gt;&lt;P&gt;8: [arles, earls, lares, laser, lears, rales, reals, seral]&lt;/P&gt;&lt;P&gt;8: [earings, erasing, gainers, reagins, regains, reginas,&lt;/P&gt;&lt;P&gt;&amp;nbsp; searing, seringa]&lt;/P&gt;&lt;P&gt;8: [peris, piers, pries, prise, ripes, speir, spier, spire]&lt;/P&gt;&lt;P&gt;12: [apers, apres, asper, pares, parse, pears, prase, presa,&lt;/P&gt;&lt;P&gt;&amp;nbsp; rapes, reaps, spare, spear]&lt;/P&gt;&lt;P&gt;11: [alerts, alters, artels, estral, laster, ratels, salter,&lt;/P&gt;&lt;P&gt;&amp;nbsp; slater, staler, stelar, talers]&lt;/P&gt;&lt;P&gt;9: [capers, crapes, escarp, pacers, parsec, recaps, scrape,&lt;/P&gt;&lt;P&gt;&amp;nbsp; secpar, spacer]&lt;/P&gt;&lt;P&gt;9: [palest, palets, pastel, petals, plates, pleats, septal,&lt;/P&gt;&lt;P&gt;&amp;nbsp; staple, tepals]&lt;/P&gt;&lt;P&gt;9: [anestri, antsier, nastier, ratines, retains, retinas,&lt;/P&gt;&lt;P&gt;&amp;nbsp; retsina, stainer, stearin]&lt;/P&gt;&lt;P&gt;8: [ates, east, eats, etas, sate, seat, seta, teas]&lt;/P&gt;&lt;P&gt;8: [carets, cartes, caster, caters, crates, reacts, recast,&lt;/P&gt;&lt;P&gt;&amp;nbsp; traces]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many of these words seem a bit bogus, but that's not the program's fault; they're in the dictionary file. Here's the &lt;A class="SourceLink" target="_blank"&gt;&lt;CODE&gt;dictionary file&lt;/CODE&gt;&lt;/A&gt; we used. It was derived from the Public Domain ENABLE benchmark reference word list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a NICE day !&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2012 05:50:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUZZLE-finding-anagram-groups/m-p/77686#M16836</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-07-30T05:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: PUZZLE - finding anagram groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUZZLE-finding-anagram-groups/m-p/77687#M16837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ksharp,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am happy to announce that it is not that hard for SAS to tackle this one either. BTW, the dictionary file only has 80,368 words instead.&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;infile 'c:\temp\dictionary.txt' truncover;&lt;/P&gt;&lt;P&gt;input var :$100.;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;array st(8) $1. _temporary_;&lt;/P&gt;&lt;P&gt;length new_var $8;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;do _n_=1 to lengthn(var);&lt;/P&gt;&lt;P&gt;st(_n_)=substr(compress(var),_n_,1);&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;call sortc(of st(*));&lt;/P&gt;&lt;P&gt;new_var=cats(of st(*));&lt;/P&gt;&lt;P&gt;call missing(of st(*));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select * from want group by new_var having count(var)&amp;gt;=9;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2012 02:10:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUZZLE-finding-anagram-groups/m-p/77687#M16837</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-08-01T02:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: PUZZLE - finding anagram groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUZZLE-finding-anagram-groups/m-p/77688#M16838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bian Hai Kuo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I am happy to announce that it is not that hard for SAS to tackle this one either.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Yeah, you got it.Acutally it is more easy for SAS than JAVA .That is the advantage of SAS at the field of DATA Processing .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe you can code it like below&amp;nbsp; to make it more less typing .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;infile 'c:\temp\dictionary.txt' truncover;&lt;/P&gt;&lt;P&gt;input ( var1 - var50) ( $1.) ;&lt;/P&gt;&lt;P&gt;........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call sortc(of var:).&lt;/P&gt;&lt;P&gt;..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run;&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>Wed, 01 Aug 2012 05:01:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUZZLE-finding-anagram-groups/m-p/77688#M16838</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-08-01T05:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: PUZZLE - finding anagram groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUZZLE-finding-anagram-groups/m-p/77689#M16839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nice exercise! And SAS is pretty good at statistics too, compared to Java &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope you will eventually find a good job doing SAS. Otherwise, that would be a waste of a great talent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2012 21:00:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUZZLE-finding-anagram-groups/m-p/77689#M16839</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-08-02T21:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: PUZZLE - finding anagram groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUZZLE-finding-anagram-groups/m-p/77690#M16840</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you. PG,&lt;/P&gt;&lt;P&gt;I wish SAS can develop a language such as Java (OOP language) to allow us to create some GUI like JavaEE or JavaFX . That would be perfect for SAS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am afraid I will let you disappoint . Nowadays, I am learning JavaEE, almost stop learning SAS, But I don't want quit, so it is the reason why I am still at this forum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the future, I hope I can master JavaEE and find a job about Java Programmer and make a living by Java.&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, 03 Aug 2012 04:08:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUZZLE-finding-anagram-groups/m-p/77690#M16840</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-08-03T04:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: PUZZLE - finding anagram groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUZZLE-finding-anagram-groups/m-p/77691#M16841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nice posting Ksharp.&amp;nbsp; Reminds me of the word puzzles I had posted a long time ago.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My concept is similar to Hai.kuo's but I solve in one data step.&amp;nbsp; This way is pretty memory intense since I also retain the string of words, which slows it down.&amp;nbsp; Removing that piece should increase processing speed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;filename&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; in &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;url&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://docs.oracle.com/javase/tutorial/collections/interfaces/examples/dictionary.txt"&gt;http://docs.oracle.com/javase/tutorial/collections/interfaces/examples/dictionary.txt&lt;/A&gt;&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;_null_&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;array&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; letter[&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;8&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;] $ &lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;_temporary_&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;length&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; word new_word $ &lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;8&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; words $ &lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;76&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; count &lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;3&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;call&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; missing(words,count);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;retain&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; addrlong dim;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; addrlong=addrlong(letter[&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;]);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; dim=dim(letter);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;declare&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; hash ha();&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; ha.definekey(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'new_word'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; ha.definedata(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'new_word'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'words'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'count'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; ha.definedone();&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;do&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;until&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;(eof);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;call&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; missing(of letter&lt;LI&gt;);&lt;/LI&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;infile&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; in &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;=eof &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;truncover&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; word $;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;call&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; pokelong(strip(word),addrlong,dim);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;call&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; sortc(of letter&lt;LI&gt;);&lt;/LI&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; new_word=strip(peekclong(addrlong,dim));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; rc=ha.check();&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; rc &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; ha.add(key:new_word,data:new_word,data:word,data:&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;else&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;do&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; ha.find();&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; ha.replace(key:new_word,data:new_word,data:catx(&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;' '&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;,words,word),data:count+&lt;/SPAN&gt;&lt;STRONG style="color: teal; background: white; font-family: 'Courier New';"&gt;1&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;end&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; ha.output(dataset:&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'blah(where=(count&amp;gt;7))'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;stop&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;print&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;=blah;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; count words;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: 0.0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2012 18:40:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUZZLE-finding-anagram-groups/m-p/77691#M16841</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2012-08-10T18:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: PUZZLE - finding anagram groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUZZLE-finding-anagram-groups/m-p/77692#M16842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe SAS web app should have more awesome&amp;nbsp; functionality combine with java language in the near future.&lt;/P&gt;&lt;P&gt;Thanks for the interesting topic.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Aug 2012 21:27:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUZZLE-finding-anagram-groups/m-p/77692#M16842</guid>
      <dc:creator>Mike_Davis</dc:creator>
      <dc:date>2012-08-10T21:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: PUZZLE - finding anagram groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUZZLE-finding-anagram-groups/m-p/77693#M16843</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Matt,&lt;/P&gt;&lt;P&gt;Yeah, I remember that puzzle you posted before. And SQL is also a good way.&lt;/P&gt;&lt;P&gt;I can't believe you find the origin URL of this question. Do you switch to learn Java now ?&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: none repeat scroll 0% 0% white;"&gt;'&lt;A class="jive-link-external-small" href="http://docs.oracle.com/javase/tutorial/collections/interfaces/examples/dictionary.txt"&gt;http://docs.oracle.com/javase/tutorial/collections/interfaces/examples/dictionary.txt&lt;/A&gt;'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: none repeat scroll 0% 0% white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: none repeat scroll 0% 0% white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: none repeat scroll 0% 0% white;"&gt;Ksharp&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2012 03:22:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUZZLE-finding-anagram-groups/m-p/77693#M16843</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-08-13T03:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: PUZZLE - finding anagram groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUZZLE-finding-anagram-groups/m-p/77694#M16844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SAS web app is a IDE tool&amp;nbsp; for Java from SAS ? If I remember correctly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2012 03:25:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUZZLE-finding-anagram-groups/m-p/77694#M16844</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-08-13T03:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: PUZZLE - finding anagram groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUZZLE-finding-anagram-groups/m-p/77695#M16845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;KSharp, I have known JAVA a long time, longer than I have used SAS.&amp;nbsp; I am much more comfortable working in SAS these days, however.&amp;nbsp; Occasionally I have to mess with the J2EE applications that work with SAS Integration Technology APIs in JAVA.&amp;nbsp; The same could be done with JavaFX as well.&amp;nbsp; Through data-step java objects you could accomplish the inverse as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2012 15:58:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUZZLE-finding-anagram-groups/m-p/77695#M16845</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2012-08-13T15:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: PUZZLE - finding anagram groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUZZLE-finding-anagram-groups/m-p/77696#M16846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think you are thinking of the SAS App Dev Studio application, it is basically a wrapper on top of the Eclipse IDE that has some add-on's specific to aiding in developing applications using the SAS Integration API's.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2012 16:00:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUZZLE-finding-anagram-groups/m-p/77696#M16846</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2012-08-13T16:00:20Z</dc:date>
    </item>
    <item>
      <title>Re: PUZZLE - finding anagram groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUZZLE-finding-anagram-groups/m-p/77697#M16847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"Through data-step java objects you could accomplish the inverse as well."&lt;/P&gt;&lt;P&gt;Unfortunately, data-step java interface is only supported by several primitive type object ,such as int string double float ..........., he can't return all of immense object from JAVA like DATE ,SWING .............&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2012 04:57:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUZZLE-finding-anagram-groups/m-p/77697#M16847</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-08-14T04:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: PUZZLE - finding anagram groups</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PUZZLE-finding-anagram-groups/m-p/77698#M16848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;but you can....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www2.sas.com/proceedings/sugi30/241-30.pdf" title="http://www2.sas.com/proceedings/sugi30/241-30.pdf"&gt;http://www2.sas.com/proceedings/sugi30/241-30.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2012 17:45:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PUZZLE-finding-anagram-groups/m-p/77698#M16848</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2012-08-14T17:45:59Z</dc:date>
    </item>
  </channel>
</rss>

