<?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 BASUG August Webinar on hashing in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/BASUG-August-Webinar-on-hashing/m-p/677326#M204294</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BASUG is hosting a free webinar in August on hashing.&amp;nbsp; But rather than simply post the description, I took a shot at a little example of using a hash table to decipher a message.&amp;nbsp; If you run the below code and check the log, hopefully you'll see readable text with registration info.&amp;nbsp; Hopefully. (If it doesn't work, please&amp;nbsp; let me know : )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Trust me, if you're interested in learning more about hashing, you don't want to miss this!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*Build the lookup table to decipher the message ;

data chars (keep=char rand);
  call streaminit(12345); 
  length chars $95;
  chars = collate(32,127);
  do i=1 to length(chars) ;
    char=substrn(chars,i,1) ;
    rand=rand("Uniform") ;
    output ;
  end ;
run;

proc sort data=chars ;
  by rand ;
run ;

data cipher ;
  set chars (keep=char);
  code=put(_n_,z2.) ;
run ;

*Read the message,
 read lookup table into a hash table, 
 and use to decipher the message
;

data _null_ ;
  if 0 then set cipher ;

  if _n_=1 then do ;
    declare hash h(dataset:"cipher") ;
    h.definekey("code") ;
    h.definedata("char") ;
    h.defineDone() ;
  end ;

  infile cards missover;
  do i=1 to 100 ;
    input code $2. @;
    if not missing(code) then do ;
      h.find(key:code) ;
      put char +(-1) @ ;
    end ;
  end ;
  put ;
  
  cards ;
374429261830144549713570459271936149082445926154544569710870882471452944294524091627451470082445128814144559083471242313
128814144592615454454824711471497045474449454449612208707138451888613871457009452944294573081452614905464575240922450409882445756124147045730814524570094573081452450969457308145271144713
427138497114380823194544880588147045100645631046070785634677074536264390856583
4352714592719361490824456114457512787819459388704524710561147024087061094945611445247184886124713813
7588545445084949098849167122714970453692617052452471056114702408706109494554614927834645527070484628289292921393081488051309240528713471497014289310071007075013483869
;

*check your log to read the message! ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;--Q.&lt;/P&gt;</description>
    <pubDate>Mon, 17 Aug 2020 18:55:26 GMT</pubDate>
    <dc:creator>Quentin</dc:creator>
    <dc:date>2020-08-17T18:55:26Z</dc:date>
    <item>
      <title>BASUG August Webinar on hashing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/BASUG-August-Webinar-on-hashing/m-p/677326#M204294</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BASUG is hosting a free webinar in August on hashing.&amp;nbsp; But rather than simply post the description, I took a shot at a little example of using a hash table to decipher a message.&amp;nbsp; If you run the below code and check the log, hopefully you'll see readable text with registration info.&amp;nbsp; Hopefully. (If it doesn't work, please&amp;nbsp; let me know : )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Trust me, if you're interested in learning more about hashing, you don't want to miss this!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*Build the lookup table to decipher the message ;

data chars (keep=char rand);
  call streaminit(12345); 
  length chars $95;
  chars = collate(32,127);
  do i=1 to length(chars) ;
    char=substrn(chars,i,1) ;
    rand=rand("Uniform") ;
    output ;
  end ;
run;

proc sort data=chars ;
  by rand ;
run ;

data cipher ;
  set chars (keep=char);
  code=put(_n_,z2.) ;
run ;

*Read the message,
 read lookup table into a hash table, 
 and use to decipher the message
;

data _null_ ;
  if 0 then set cipher ;

  if _n_=1 then do ;
    declare hash h(dataset:"cipher") ;
    h.definekey("code") ;
    h.definedata("char") ;
    h.defineDone() ;
  end ;

  infile cards missover;
  do i=1 to 100 ;
    input code $2. @;
    if not missing(code) then do ;
      h.find(key:code) ;
      put char +(-1) @ ;
    end ;
  end ;
  put ;
  
  cards ;
374429261830144549713570459271936149082445926154544569710870882471452944294524091627451470082445128814144559083471242313
128814144592615454454824711471497045474449454449612208707138451888613871457009452944294573081452614905464575240922450409882445756124147045730814524570094573081452450969457308145271144713
427138497114380823194544880588147045100645631046070785634677074536264390856583
4352714592719361490824456114457512787819459388704524710561147024087061094945611445247184886124713813
7588545445084949098849167122714970453692617052452471056114702408706109494554614927834645527070484628289292921393081488051309240528713471497014289310071007075013483869
;

*check your log to read the message! ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;--Q.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 18:55:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/BASUG-August-Webinar-on-hashing/m-p/677326#M204294</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2020-08-17T18:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: BASUG August Webinar on hashing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/BASUG-August-Webinar-on-hashing/m-p/677339#M204297</link>
      <description>&lt;P&gt;Clever &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Looking forward!&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 20:02:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/BASUG-August-Webinar-on-hashing/m-p/677339#M204297</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-08-17T20:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: BASUG August Webinar on hashing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/BASUG-August-Webinar-on-hashing/m-p/677344#M204300</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&amp;nbsp;.&amp;nbsp; Glad it worked!&amp;nbsp; I've been enjoying the hashing posts on your blog, e.g.&amp;nbsp;&lt;A href="https://sasnrd.com/sas-hash-object-content-log-puthash/" target="_blank"&gt;https://sasnrd.com/sas-hash-object-content-log-puthash/&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 20:13:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/BASUG-August-Webinar-on-hashing/m-p/677344#M204300</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2020-08-17T20:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: BASUG August Webinar on hashing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/BASUG-August-Webinar-on-hashing/m-p/677377#M204315</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19879"&gt;@Quentin&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now that's a novel means of communication.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I signed up.&amp;nbsp; Hopefully no one will assign me a conflict at work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;P.S.&amp;nbsp; I suppose a more proper response would be:&lt;/P&gt;
&lt;PRE&gt;91710824452588714970614919
435208492745230988453471242345228816524569092445230988244527614938456149346170087061094913
41450524087071698854542345081616714870194508493845414508224554090927614905456909249208243845700945617013
29614916712471542345230988241419
336122&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Aug 2020 04:31:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/BASUG-August-Webinar-on-hashing/m-p/677377#M204315</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2020-08-18T04:31:27Z</dc:date>
    </item>
  </channel>
</rss>

