<?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: Breaking a long macro length greater than 65000 bytes in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Breaking-a-long-macro-length-greater-than-65000-bytes/m-p/872251#M344602</link>
    <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;wrote, do it in data step:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  declare hash H();
  H.defineKey("hash_list");
  H.defineData("_N_");
  H.defineDone();

  /* put lists into hash table */
  do until(eof);
    set ValueList1(keep=hash_list1 hash_list2) end=eof;
    _N_=H.add(key:hash_list1,data:1);
    _N_=H.add(key:hash_list2,data:1);
    drop hash_list1 hash_list2;
  end;

  /* search full dataset */
  do until(endFull);
    set Fulllist end=endFull;
    if 0=H.check() then output;
  end;

  stop;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
    <pubDate>Wed, 26 Apr 2023 14:09:55 GMT</pubDate>
    <dc:creator>yabwon</dc:creator>
    <dc:date>2023-04-26T14:09:55Z</dc:date>
    <item>
      <title>Breaking a long macro length greater than 65000 bytes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Breaking-a-long-macro-length-greater-than-65000-bytes/m-p/872238#M344596</link>
      <description>&lt;P&gt;Dear Community members,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; I have a dataset where I need to get all the hashed data&amp;nbsp; into a macro variable &amp;amp; search that in original dataset. I am giving sample data below. I could do the code for one macro variable (hash_list1) , but not the other one (hash_list2).&amp;nbsp; Can anyone help me how to write the code generically so that I can use the same code for hash_list1 &amp;amp; hash_list2. For example, you can use&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;Macro Parameters &lt;/SPAN&gt;&lt;/STRONG&gt;so that this code can be used anywhere. Any help with&amp;nbsp; this is appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;I have coded so that I can do it for hash_list1 and I don't want to repeat the same code for hash_list2. Could someone help me to write the code? Thanks in advance !!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;options symbolgen mlogic mprint; 


/* The total dataset */
data FullList; 
do List = 1 to 1000000; 
hash_list=upcase(put(sha256(strip(put(list,best.))||"d8pZpXvS0Q"),$hex64.));
output; 
end; 
run;

/*  create hash_list1 &amp;amp; hash_list2 macros*/

data ValueList1;
   call streaminit(1000000);
   do i = 1 to 10000;
   list1 = rand("integer", 100, 1000000);
   hash_list1=upcase(put(sha256(strip(put(list1,best.))||"d8pZpXvS0Q"),$hex64.));
   list2 = rand("integer", 1000, 1000000);
   hash_list2=upcase(put(sha256(strip(put(list2,best.))||"d8pZpXvS0Q"),$hex64.));

   output;
   end;
run;

/* The number of records of the macro dataset*/

data ValueList2;
set ValueList1;
Count + 1;
call symputx('Count',Count);
run;

%put &amp;amp;Count.;

/* Break long macro into bins */

data _null_;
NumberBins=floor(&amp;amp;Count./500);
call symputx('NumberBins',NumberBins);
run;

%put &amp;amp;NumberBins. ;

/* get the values into macro variables */

%macro AddToBins();
%do BinCount = 0 %to &amp;amp;NumberBins.;
data _null_;
L=cats('L',&amp;amp;BinCount.);
call symputx('L',L);
run;
%global &amp;amp;L.;
proc sql noprint;
select "'"||strip(hash_list1)||"'" into :&amp;amp;L. separated by ','
from ValueList2
where &amp;amp;BinCount.*500 &amp;lt;= Count &amp;lt;= (&amp;amp;BinCount.*500)+(500-1) ;
quit;
%end;
%mend AddToBins;
%AddToBins;


%put &amp;amp;L0.***&amp;amp;L20. ;

/* code to include for the split macro variables*/

%macro splits (n_splits);
   %local k;
   %do k = 1 %to &amp;amp;n_splits;
      hash_list in (&amp;amp;&amp;amp;L&amp;amp;k)
      %if &amp;amp;k &amp;lt; &amp;amp;n_splits %then or;
   %end;
%mend splits;


/* Search from original data to get the values from macro variables*/

data SearchResult2; 
set FullList; 
where(%splits (&amp;amp;NumberBins.)); 
run;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Apr 2023 13:20:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Breaking-a-long-macro-length-greater-than-65000-bytes/m-p/872238#M344596</guid>
      <dc:creator>buddha_d</dc:creator>
      <dc:date>2023-04-26T13:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: Breaking a long macro length greater than 65000 bytes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Breaking-a-long-macro-length-greater-than-65000-bytes/m-p/872244#M344600</link>
      <description>&lt;P&gt;Why do you need the values in a macro variable?&amp;nbsp; Why not just leave the values in a dataset and use the dataset in your query?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 13:36:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Breaking-a-long-macro-length-greater-than-65000-bytes/m-p/872244#M344600</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-04-26T13:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Breaking a long macro length greater than 65000 bytes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Breaking-a-long-macro-length-greater-than-65000-bytes/m-p/872251#M344602</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;wrote, do it in data step:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  declare hash H();
  H.defineKey("hash_list");
  H.defineData("_N_");
  H.defineDone();

  /* put lists into hash table */
  do until(eof);
    set ValueList1(keep=hash_list1 hash_list2) end=eof;
    _N_=H.add(key:hash_list1,data:1);
    _N_=H.add(key:hash_list2,data:1);
    drop hash_list1 hash_list2;
  end;

  /* search full dataset */
  do until(endFull);
    set Fulllist end=endFull;
    if 0=H.check() then output;
  end;

  stop;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 14:09:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Breaking-a-long-macro-length-greater-than-65000-bytes/m-p/872251#M344602</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-04-26T14:09:55Z</dc:date>
    </item>
    <item>
      <title>Re: Breaking a long macro length greater than 65000 bytes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Breaking-a-long-macro-length-greater-than-65000-bytes/m-p/872255#M344604</link>
      <description>Tom, I need to have them in macros as I am running query with Passthrough for SQL DB.</description>
      <pubDate>Wed, 26 Apr 2023 14:25:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Breaking-a-long-macro-length-greater-than-65000-bytes/m-p/872255#M344604</guid>
      <dc:creator>buddha_d</dc:creator>
      <dc:date>2023-04-26T14:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: Breaking a long macro length greater than 65000 bytes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Breaking-a-long-macro-length-greater-than-65000-bytes/m-p/872257#M344606</link>
      <description>&lt;P&gt;yabwon, The actual data is in SQL and I am connecting through SAS using PassThrough facility. Hence, I could only store in macros and search those string against the Database. I published the sample data so that every one can understand the code easily. Thanks for asking.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 14:28:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Breaking-a-long-macro-length-greater-than-65000-bytes/m-p/872257#M344606</guid>
      <dc:creator>buddha_d</dc:creator>
      <dc:date>2023-04-26T14:28:16Z</dc:date>
    </item>
    <item>
      <title>Re: Breaking a long macro length greater than 65000 bytes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Breaking-a-long-macro-length-greater-than-65000-bytes/m-p/872258#M344607</link>
      <description>&lt;P&gt;are you putting this list into something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;hashedVariable in (&amp;amp;listOfHashes.)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;?&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 14:29:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Breaking-a-long-macro-length-greater-than-65000-bytes/m-p/872258#M344607</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-04-26T14:29:18Z</dc:date>
    </item>
    <item>
      <title>Re: Breaking a long macro length greater than 65000 bytes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Breaking-a-long-macro-length-greater-than-65000-bytes/m-p/872266#M344610</link>
      <description>&lt;P&gt;You need to watch out that the generated SQL is not too long for the remote database.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The easiest way to put 10 pounds in the the 5 pound bag of a macro variable is to use a macro variable that references other macro variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Consider this example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  call symputx('v1','A B C');
  call symputx('v2','D E F');
  call symputx('both','&amp;amp;v1 &amp;amp;v2');
run;
%put &amp;amp;=both;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;828  %put &amp;amp;=both;
BOTH=A B C D E F
&lt;/PRE&gt;
&lt;P&gt;So you can use a data step to generate both the series of shorter macro variables and also one extra macro variable that references all of the others.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let's try it with the values of NAME from SASHELP.CLASS.&amp;nbsp; So let's limit macro variables to a maximum length of 40 bytes so that we will need more than one to hold all of the names.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  length one all $100 ;
  retain all varnum;
  do until(eof or (length(one) &amp;gt; 40));
    set sashelp.class end=eof;
    one = catx(',',one,quote(trim(name),"'"));
  end;
  varnum+1;
  call symputx(cats('v',varnum),one);
  all=catx(',',all,cats('&amp;amp;v',varnum));
  if eof then call symputx('all',all);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result&lt;/P&gt;
&lt;PRE&gt;934  %put &amp;amp;=v1;
V1='Alfred','Alice','Barbara','Carol','Henry'
935  %put &amp;amp;=v2;
V2='James','Jane','Janet','Jeffrey','John','Joyce'
936  %put &amp;amp;=v3;
V3='Judy','Louise','Mary','Philip','Robert','Ronald'
937  %put &amp;amp;=v4;
V4='Thomas','William'
938  %put ALL=%superq(all);
ALL=&amp;amp;v1,&amp;amp;v2,&amp;amp;v3,&amp;amp;v4
939  %put &amp;amp;=all ;
ALL='Alfred','Alice','Barbara','Carol','Henry','James','Jane','Janet','Jeffrey','John','Joyce','Judy','Louise','Mary','Philip','Robe
rt','Ronald','Thomas','William'

&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Apr 2023 14:40:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Breaking-a-long-macro-length-greater-than-65000-bytes/m-p/872266#M344610</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-04-26T14:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: Breaking a long macro length greater than 65000 bytes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Breaking-a-long-macro-length-greater-than-65000-bytes/m-p/872275#M344612</link>
      <description>&lt;P&gt;Tom, It works well with small dataset. Could you implement the same for huge dataset with over 65000 bytes for a variable? I gave sample dataset so that what ever logic we could implement can be applied to that dataset and make sure it works. I need to break the string into multiple bins and can't concatenate into a single macro variable (as that would exceed the macro limit of 65,000 bytes). I separated it out into multiple strings with less than 65,000 bytes and query individual macro in the code as shown below. Thanks&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;%macro splits (n_splits);
   %local k;
   %do k = 1 %to &amp;amp;n_splits;
      hash_list in (&amp;amp;&amp;amp;L&amp;amp;k)
      %if &amp;amp;k &amp;lt; &amp;amp;n_splits %then or;
   %end;
%mend splits;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Apr 2023 14:50:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Breaking-a-long-macro-length-greater-than-65000-bytes/m-p/872275#M344612</guid>
      <dc:creator>buddha_d</dc:creator>
      <dc:date>2023-04-26T14:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: Breaking a long macro length greater than 65000 bytes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Breaking-a-long-macro-length-greater-than-65000-bytes/m-p/872276#M344613</link>
      <description>&lt;P&gt;The correct (and simple) way of doing this is to upload the lookup data to a temporary table in the DB and join there.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 14:52:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Breaking-a-long-macro-length-greater-than-65000-bytes/m-p/872276#M344613</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2023-04-26T14:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: Breaking a long macro length greater than 65000 bytes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Breaking-a-long-macro-length-greater-than-65000-bytes/m-p/872282#M344615</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/139130"&gt;@buddha_d&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Tom, It works well with small dataset. Could you implement the same for huge dataset with over 65000 bytes for a variable? I gave sample dataset so that what ever logic we could implement can be applied to that dataset and make sure it works. I need to break the string into multiple bins and can't concatenate into a single macro variable (as that would exceed the macro limit of 65,000 bytes). I separated it out into multiple strings with less than 65,000 bytes and query individual macro in the code as shown below. Thanks&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=""&gt;%macro splits (n_splits);
   %local k;
   %do k = 1 %to &amp;amp;n_splits;
      hash_list in (&amp;amp;&amp;amp;L&amp;amp;k)
      %if &amp;amp;k &amp;lt; &amp;amp;n_splits %then or;
   %end;
%mend splits;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I cannot understand how this SPLITS macro has anything to do with your question of how to generate a long list of values to use in pass thru SQL query.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you saying there is some limit imposed by the remote database such that you cannot just use a single IN operator with the full list of values?&lt;/P&gt;
&lt;P&gt;Like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;hash_list in (&amp;amp;all)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But instead have to make a series of&amp;nbsp; IN operators on shorter lists?&lt;/P&gt;
&lt;P&gt;If so then adapt my code so that instead of generating ALL as&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&amp;amp;v1,&amp;amp;v2...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It generates it as&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;hash_list in (&amp;amp;v1) or hash_list in (&amp;amp;v2) ...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And then instead of using this in your query:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where hash_list in (&amp;amp;all)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You could use&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where &amp;amp;all&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note that when adapting my example to your actual data that you will need make lists of less than 32K bytes (the limit for a data step variable) instead the larger 64K limit on the length of a macro variable.&amp;nbsp; Also notice how I stopped adding values when the length was longer than 40 instead of trying to hit exactly 100.&amp;nbsp; It is better to make the individual list a little shorter than have a value get truncated.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 15:02:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Breaking-a-long-macro-length-greater-than-65000-bytes/m-p/872282#M344615</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-04-26T15:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: Breaking a long macro length greater than 65000 bytes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Breaking-a-long-macro-length-greater-than-65000-bytes/m-p/872292#M344618</link>
      <description>&lt;P&gt;ok, so I assume you cannot upload your data into temporary table, I had such situation with one oracle data base. My proposition is to use macroAray package (&lt;A href="https://github.com/SASPAC/macroarray" target="_blank"&gt;https://github.com/SASPAC/macroarray&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;steps are:&lt;/P&gt;
&lt;P&gt;1) enable SAS Packages Framework&lt;/P&gt;
&lt;P&gt;2) install&amp;nbsp;&lt;CODE class=" language-sas"&gt;macroArray&lt;/CODE&gt; package&lt;/P&gt;
&lt;P&gt;3) load the package into your session&lt;/P&gt;
&lt;P&gt;4) I commented out help info call&amp;nbsp;&lt;/P&gt;
&lt;P&gt;5) create temporary file with one list with single-quoted strings&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;6) use&amp;nbsp;&lt;CODE class=" language-sas"&gt;array&lt;/CODE&gt; macro to create list of macro variables with &lt;CODE class=" language-sas"&gt;hash_list &lt;/CODE&gt;prefix&lt;/P&gt;
&lt;P&gt;(the put statement prints out first 3 into the log)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;7) use&amp;nbsp;&lt;CODE class=" language-sas"&gt;do_over&lt;/CODE&gt; macro inside SQL pass through&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here is the code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename packages "%sysfunc(pathname(work))"; /* setup WORK as temporary directory for packages */
filename SPFinit url "https://raw.githubusercontent.com/yabwon/SAS_PACKAGES/main/SPF/SPFinit.sas";
%include SPFinit; /* enable the framework */

%installPackage(macroArray) /* install a package */
%loadPackage(macroArray)    /* load the package content into the SAS session */

/*
%helpPackage(macroArray, '%array()')
%helpPackage(macroArray, '%do_over()')
*/


data temp;
  length hash_list $ 70;
  set 
    ValueList1(keep=hash_list1 rename=(hash_list1=hash_list))   
    ValueList1(keep=hash_list2 rename=(hash_list2=hash_list))
  ;
  hash_list=quote(strip(hash_list),"'");
run;




%array(ds = temp, vars = hash_list|, macarray=Y)

%put %hash_list(1) %hash_list(2) %hash_list(3);

options NOmprint;
proc sql;
  connect to DATABASE(.....);


  select * from connection to
  (

    select * 
    form TABLE
    where hashedID in (
        %do_over(hash_list, between=%str(,))
        )
  )
  ; 
run;

/* this is just a test code so you could see how %do_over() works */
data test_do_over;
  do i = %do_over(hash_list, between=%str(,)) ;
    output;
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If the&amp;nbsp;&lt;CODE class=" language-sas"&gt;hashedID in (...)&lt;/CODE&gt; list is limited to some small number (Oracle has 1000 limitation) you can tray to use the WITH clause (&lt;A href="https://www.geeksforgeeks.org/sql-with-clause/)" target="_blank"&gt;https://www.geeksforgeeks.org/sql-with-clause/)&lt;/A&gt;&amp;nbsp;and create "in code temporary table":&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;with tempTable as 
(

%do_over(hash_list
, phrase=%nrstr(select %hash_list(&amp;amp;_i_) as hasID )
, between=%str( union all )
)

)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;which will produce something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;with tempTable as 
(

select 'VJKAUY7HGVJZ7UTGHVBZJKF3UT8Y' as hasID 
union all
select 'VJKNCVJKAW3457U8YGAUY7HGVJZ7' as hasID 
union all
...
select 'KSDT89723T7GVSDXFJKZNVIE90TG' as hasID 

)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 15:25:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Breaking-a-long-macro-length-greater-than-65000-bytes/m-p/872292#M344618</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-04-26T15:25:43Z</dc:date>
    </item>
  </channel>
</rss>

