<?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: Can HASH Object do the same job? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Can-HASH-Object-do-the-same-job/m-p/832653#M329129</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16940"&gt;@GPatel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Tom:&lt;BR /&gt;My goal is to re-engineer the process.&lt;BR /&gt;I would like to use HASH method. Is it feasible?&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It could work.&amp;nbsp; But it would be more code to maintain and require longer to run.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Essentially you would just end up replacing the IN operator with a call to the FIND() method.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 10 Sep 2022 15:23:24 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2022-09-10T15:23:24Z</dc:date>
    <item>
      <title>Can HASH Object do the same job?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-HASH-Object-do-the-same-job/m-p/832632#M329120</link>
      <description>&lt;DIV class="gmail_default"&gt;I have attached sample "sample_qc_diab" SAS dataset. Following SAS code uses array to identify&amp;nbsp;"Diabetes" case using Array.&amp;nbsp; I have more then 14 Mil records and 50 variables in each FY&amp;nbsp; (from 09-22) and Array process takes on an average 15 to 20 minutes.&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="gmail_default"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="gmail_default"&gt;Is it possible to get the same results using HASH for efficiency ?&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="gmail_default"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="gmail_default"&gt;Appreciate any help from the community.&lt;/DIV&gt;
&lt;DIV class="gmail_default"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="gmail_default"&gt;libname xyz "D:\temp\xyz";&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="gmail_default"&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;%global lkup lkup2;&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;%let lkup = %str('250' 'E109' 'E111');&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;%let lkup2 = %str('27889');&lt;/SPAN&gt;&lt;/P&gt;
&lt;DIV class="gmail_default"&gt;&lt;BR /&gt;data sample_qc;;&lt;BR /&gt;set xyz.sample_qc_diab &amp;nbsp; ;&lt;BR /&gt;run; &amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="gmail_default"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="gmail_default"&gt;&lt;BR /&gt;data xx;&lt;BR /&gt;&amp;nbsp;set sample_qc(rename=( cpt_4=cpt4 cpt_5=cpt5 cpt_6=cpt6 cpt_7=cpt7&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cpt_8=cpt8 cpt_9=cpt9 cpt_10=cpt10 cpt_11=cpt11 cpt_12=cpt12 cpt_13=cpt13));&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;array tem{1:10} dx1-dx10;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; do i=1 to 10;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; if tem(i) ^=" " then do;&lt;BR /&gt;&amp;nbsp; if tem(i) in (&amp;amp;lkup) then flag=1;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;end;&lt;BR /&gt;&amp;nbsp; end; &lt;BR /&gt;&amp;nbsp; &amp;nbsp;array cpt{4:13} cpt4-cpt13;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; do j= 4 to 13; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if not missing(cpt[j]) &amp;nbsp; then do;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if cpt(j) in (&amp;amp;lkup2) then flag=1;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; end;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; end; &amp;nbsp; &amp;nbsp; &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; if flag=1; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;BR /&gt;run;&lt;BR /&gt;proc print data=xx(obs=10 );&lt;BR /&gt;var cpt: dx: fy flag;&lt;BR /&gt;run;&lt;/DIV&gt;</description>
      <pubDate>Sat, 10 Sep 2022 13:20:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-HASH-Object-do-the-same-job/m-p/832632#M329120</guid>
      <dc:creator>GPatel</dc:creator>
      <dc:date>2022-09-10T13:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: Can HASH Object do the same job?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-HASH-Object-do-the-same-job/m-p/832639#M329125</link>
      <description>&lt;P&gt;How would a hash object help? What would it contain? How would that reduce processing time?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Explain in words what it is that the program id doing:&lt;/P&gt;
&lt;LI-SPOILER&gt;Looks to me like you are finding observations that have EITHER the diagnosis code OR the procedure code.&lt;/LI-SPOILER&gt;
&lt;P&gt;Why are you skipping CPT1 to CPT3 ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can simplify your code a little.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let lkup = '250' 'E109' 'E111' ;
%let lkup2 = '27889' ;
data xx;
  set xyz.sample_qc_diab ;
  array diag dx1-dx10;
  array proc cpt_4-cpt_13 ;
  flag=0;
  do index=1 to dim(diag) while (not flag);
    flag = diag[index] in (&amp;amp;lkup) ;
  end;
  do index=1 to dim(proc) while (not flag);
    flag = proc[index] in (&amp;amp;lkup2) ;
  end;
  if flag ;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Sep 2022 14:09:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-HASH-Object-do-the-same-job/m-p/832639#M329125</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-09-10T14:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: Can HASH Object do the same job?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-HASH-Object-do-the-same-job/m-p/832643#M329126</link>
      <description>These are considered to be keys  '250' 'E109' 'E111'  '27889'  or look up table.&lt;BR /&gt;From big dataset, look for these keys in dx1-dx10 or cpt4-cpt13. If you encounter key, create a flag as 1. &lt;BR /&gt;One can create small dataset with four keys '250' ,'E109', 'E111',  '27889' , and use these keys to identify and isolate records where you see these values.  &lt;BR /&gt;</description>
      <pubDate>Sat, 10 Sep 2022 14:20:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-HASH-Object-do-the-same-job/m-p/832643#M329126</guid>
      <dc:creator>GPatel</dc:creator>
      <dc:date>2022-09-10T14:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: Can HASH Object do the same job?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-HASH-Object-do-the-same-job/m-p/832647#M329127</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16940"&gt;@GPatel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;These are considered to be keys '250' 'E109' 'E111' '27889' or look up table.&lt;BR /&gt;From big dataset, look for these keys in dx1-dx10 or cpt4-cpt13. If you encounter key, create a flag as 1. &lt;BR /&gt;One can create small dataset with four keys '250' ,'E109', 'E111', '27889' , and use these keys to identify and isolate records where you see these values. &lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You could.&amp;nbsp; But it would add extra processing time over the current method.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But it would allow two enhancements that might help.&lt;/P&gt;
&lt;P&gt;1) The list of diagnosis codes could be larger than want can be put into a single macro variable.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) You could possibly try to retrieve some other information from the lookup table.&amp;nbsp; But that is not likely in this case since you are scanning multiple different variables with diagnosis codes so what possible auxiliary information could you retrieve from the lookup table?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to store the diagnosis codes into a lookup table you could just add a step to pull them into the macro variable so that you could continue to use the existing data step to filter.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data codes;
  input type $ code $ ;
cards;
ICD 250
ICD E109
ICD E111
CPT 27889
;

proc sql noprint;
  select quote(trim(code))
    into :lkup separated by ' '
    from codes
    where type='ICD'
  ;
  select quote(trim(code))
    into :lkup2 separated by ' '
    from codes
    where type='CPT'
  ;
quit;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Sep 2022 14:37:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-HASH-Object-do-the-same-job/m-p/832647#M329127</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-09-10T14:37:59Z</dc:date>
    </item>
    <item>
      <title>Re: Can HASH Object do the same job?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-HASH-Object-do-the-same-job/m-p/832648#M329128</link>
      <description>Tom:&lt;BR /&gt;My goal is to re-engineer the process.&lt;BR /&gt;I would like to use HASH method. Is it feasible?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 10 Sep 2022 14:48:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-HASH-Object-do-the-same-job/m-p/832648#M329128</guid>
      <dc:creator>GPatel</dc:creator>
      <dc:date>2022-09-10T14:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: Can HASH Object do the same job?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-HASH-Object-do-the-same-job/m-p/832653#M329129</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16940"&gt;@GPatel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Tom:&lt;BR /&gt;My goal is to re-engineer the process.&lt;BR /&gt;I would like to use HASH method. Is it feasible?&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It could work.&amp;nbsp; But it would be more code to maintain and require longer to run.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Essentially you would just end up replacing the IN operator with a call to the FIND() method.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Sep 2022 15:23:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-HASH-Object-do-the-same-job/m-p/832653#M329129</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-09-10T15:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: Can HASH Object do the same job?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-HASH-Object-do-the-same-job/m-p/832655#M329131</link>
      <description>Tom:&lt;BR /&gt;The end goal is to capture and monitor total visits, associated costs,  demographic matrix, and medications  and supplies, etc. by FY, Region, Age etc.&lt;BR /&gt;I want to compare time it takes by both Array and HASH methods with real data (15-20 Million records) on windows unix platform.&lt;BR /&gt;I am sure, HASH will be the choice of the game since it is faster and efficient for table look up activities.  &lt;BR /&gt;</description>
      <pubDate>Sat, 10 Sep 2022 15:50:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-HASH-Object-do-the-same-job/m-p/832655#M329131</guid>
      <dc:creator>GPatel</dc:creator>
      <dc:date>2022-09-10T15:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: Can HASH Object do the same job?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-HASH-Object-do-the-same-job/m-p/832674#M329137</link>
      <description>&lt;P&gt;&lt;EM&gt;"Is it possible to get the same results using HASH for efficiency?"&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To me, the answer is two-fold. Yes, it is possible to do the same thing with a hash object. But for efficiency, I don't see how the hash object will do any good.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You want to re-engineer the process. How? What values would go into the hash object? That is the real question before we can answer if it even makes sense to use a hash object.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The hash object is very powerful and under the right circumstances, it can boost performance&amp;nbsp;tremendously. However, it is not a magic wand that does wonders to the run-time of SAS processes whenever we use it &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;Best Regards Peter.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Sep 2022 18:40:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-HASH-Object-do-the-same-job/m-p/832674#M329137</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-09-10T18:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: Can HASH Object do the same job?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-HASH-Object-do-the-same-job/m-p/832682#M329142</link>
      <description>PeterClemmensen and Tom : &lt;BR /&gt;&lt;BR /&gt;I created following sample program and used HASH. I got the expected results.&lt;BR /&gt;It does what is expected. However, with the real data ( all 10 dxi's and 13 cpti's) code will be  little bit messy. Can any body shed some more lights to make SAS more dynamic? I have to dedup dxi's and cpti's.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;data small; &lt;BR /&gt;length event $ 5.; &lt;BR /&gt;  input event $5.;&lt;BR /&gt;cards;&lt;BR /&gt;250&lt;BR /&gt;E109&lt;BR /&gt;E111&lt;BR /&gt;27889&lt;BR /&gt;;&lt;BR /&gt;run; &lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;data sample_qc;;&lt;BR /&gt;length event $ 10;  &lt;BR /&gt;set  sample_qc_diab   ;&lt;BR /&gt;event=dx1; output; event=dx2; output;event=dx3; output; event=dx4; output; event=dx5; output;&lt;BR /&gt;event=dx6; output; event=dx7; output;event=dx8; output; event=dx9; output; event=dx10; output;&lt;BR /&gt;&lt;BR /&gt; event=cpt_4; output; event=cpt_5; output;&lt;BR /&gt;event=cpt_6; output; event=cpt_7; output;event=cpt_8; output; event=cpt_9; output; event=cpt_10; output;&lt;BR /&gt;event=cpt_11; output; event=cpt_12; output;event=cpt_13; output;&lt;BR /&gt;run;   &lt;BR /&gt;&lt;BR /&gt;data subset; &lt;BR /&gt;   length flag $ 5.;  &lt;BR /&gt;if _N_ = 1 then do;   &lt;BR /&gt;declare hash h(dataset:'small'); &lt;BR /&gt;h.definekey('EVENT'); &lt;BR /&gt;H.DEFINEDONE(); &lt;BR /&gt;END;    &lt;BR /&gt;set sample_qc ;&lt;BR /&gt;    &lt;BR /&gt;If h.find() = 0 then flag='Yes';&lt;BR /&gt;If h.find() ^= 0 then flag='No';   &lt;BR /&gt; if flag='Yes';&lt;BR /&gt;run;</description>
      <pubDate>Sat, 10 Sep 2022 20:40:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-HASH-Object-do-the-same-job/m-p/832682#M329142</guid>
      <dc:creator>GPatel</dc:creator>
      <dc:date>2022-09-10T20:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: Can HASH Object do the same job?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-HASH-Object-do-the-same-job/m-p/832713#M329150</link>
      <description>&lt;P&gt;Are you after something like below?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.small;
  input event :$5.;
  cards;
250
E109
E111
27889
;
run;

libname sample 'c:\temp';
data subset;
  length flag $1;

  if _n_ = 1 then
    do;
      if 0 then set work.small(keep=event);
      declare hash h(dataset:'small');
      h.defineKey('event');
      h.defineDone();
    end;
  call missing(of _all_);

  set sample.sample_qc_diab;

  array _ev {*} cpt_4-cpt_13 dx1-dx10;
  do _i=1 to dim(_ev);
    if h.find(key:_ev[_i])=0 then
      do;
        flag='Y';
        leave;
      end;
  end;

/*  if missing(event) then flag='N';*/
  if flag='Y' then output;

run;
libname sample clear;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1662863561071.png" style="width: 592px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/75128iA84276BD2DB6F3B4/image-dimensions/592x176?v=v2" width="592" height="176" role="button" title="Patrick_0-1662863561071.png" alt="Patrick_0-1662863561071.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Sep 2022 02:32:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-HASH-Object-do-the-same-job/m-p/832713#M329150</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-09-11T02:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: Can HASH Object do the same job?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-HASH-Object-do-the-same-job/m-p/832856#M329232</link>
      <description>GM Patrick, &lt;BR /&gt; I like and accept your solution to my posting. It is what I was looking for, and it works like a charm. Appreciate your help and time.&lt;BR /&gt;One question to ask you : Can small data entries be a macro variable, and then use this macro variable in HASH reference as  h.defineKey('event');?&lt;BR /&gt;&lt;BR /&gt;Regards, GPatel&lt;BR /&gt;</description>
      <pubDate>Mon, 12 Sep 2022 10:50:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-HASH-Object-do-the-same-job/m-p/832856#M329232</guid>
      <dc:creator>GPatel</dc:creator>
      <dc:date>2022-09-12T10:50:45Z</dc:date>
    </item>
    <item>
      <title>Re: Can HASH Object do the same job?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-HASH-Object-do-the-same-job/m-p/832860#M329234</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16940"&gt;@GPatel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;GM Patrick, &lt;BR /&gt;I like and accept your solution to my posting. It is what I was looking for, and it works like a charm. Appreciate your help and time.&lt;BR /&gt;One question to ask you : Can small data entries be a macro variable, and then use this macro variable in HASH reference as h.defineKey('event');?&lt;BR /&gt;&lt;BR /&gt;Regards, GPatel&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If I understand your question right then NO. You need a table/view as source for loading a hash table.&lt;/P&gt;
&lt;P&gt;You can always create a macro variable with a string of values and then use that via an IN operator: variable in (&amp;amp;macro_var).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have a list of key/value pairs then you could also create a format using cntlin= and then use the format in syntax like: if not missint(put(variable,&amp;lt;format&amp;gt;)) then do...&lt;BR /&gt;(just define the other case as returning a blank value).&lt;/P&gt;</description>
      <pubDate>Mon, 12 Sep 2022 11:04:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-HASH-Object-do-the-same-job/m-p/832860#M329234</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-09-12T11:04:35Z</dc:date>
    </item>
  </channel>
</rss>

