<?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: insufficient memory in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/insufficient-memory/m-p/911783#M40822</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/296098"&gt;@sanjaymane7&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Length of employee id is 10 char in both table.&lt;/P&gt;
&lt;P&gt;I am using laptop with the following config - 32GB ram and 500 GB hard disk, processor -&amp;nbsp;Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz 1.99 GHz, system type -&amp;nbsp;64-bit operating system, x64-based processor.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The relevant bit is where SAS is installed and executes (not EG/Studio but the server you connect to). The specs of your laptop are only relevant if you connect to a locally installed SAS.&lt;/P&gt;
&lt;P&gt;IF you have a locally installed SAS then follow&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;'s recommendation and increase the max memsize that a SAS session can consume to something like 16GB.&lt;/P&gt;</description>
    <pubDate>Wed, 17 Jan 2024 14:54:51 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2024-01-17T14:54:51Z</dc:date>
    <item>
      <title>insufficient memory</title>
      <link>https://communities.sas.com/t5/New-SAS-User/insufficient-memory/m-p/911704#M40809</link>
      <description>&lt;P&gt;Hi, I am facing an insufficient memory error while executing the below code. I have 32 GB RAM, 500 SSD/ HD laptop. Please suggest.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data A;&lt;BR /&gt;input Employee_Id Date :ddmmyy. Plan $ ;&lt;BR /&gt;format Date date9. ;&lt;BR /&gt;cards;&lt;/P&gt;
&lt;P&gt;1100589 03-02-2023 Silver&lt;BR /&gt;1100589 04-02-2023 Silver&lt;BR /&gt;1100589 05-02-2023 Silver&lt;BR /&gt;1100589 06-02-2023 Bronze&lt;BR /&gt;1100589 19-05-2023 Platinum&lt;BR /&gt;1100589 19-05-2023 Gold&lt;BR /&gt;1100589 23-05-2023 Bronze&lt;BR /&gt;1100589 25-05-2023 Bronze&lt;BR /&gt;1100589 27-05-2023 Bronze&lt;BR /&gt;1100589 06-07-2023 Gold&lt;BR /&gt;1100589 07-07-2023 Bronze&lt;BR /&gt;1100589 12-07-2023 Bronze&lt;BR /&gt;1100589 30-10-2023 Bronze&lt;BR /&gt;1100600 . .&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;data B;&lt;BR /&gt;input Employee_Id Date :ddmmyy. Plan $ Claim_amt ;&lt;BR /&gt;format Date date9. ;&lt;BR /&gt;cards;&lt;BR /&gt;1100589 01-02-2023 . 100&lt;BR /&gt;1100589 08-02-2023 . 200&lt;BR /&gt;1100589 21-04-2023 . 300&lt;BR /&gt;1100589 11-07-2023 . 400&lt;BR /&gt;1100589 30-10-2023 . 500&lt;BR /&gt;1100600 01-11-2023 . 700&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;data want;&lt;BR /&gt;if _n_=1 then do;&lt;BR /&gt;if 0 then set A;&lt;BR /&gt;declare hash h(dataset:'A');&lt;BR /&gt;h.definekey('Employee_Id','Date');&lt;BR /&gt;h.definedata('Plan');&lt;BR /&gt;h.definedone();&lt;BR /&gt;end;&lt;BR /&gt;set B;&lt;BR /&gt;do k=Date to Date+7 by +1;&lt;BR /&gt;if h.find(key:Employee_Id,key:k)=0 then leave;&lt;BR /&gt;end;&lt;BR /&gt;format k date9.;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 22:02:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/insufficient-memory/m-p/911704#M40809</guid>
      <dc:creator>sanjaymane7</dc:creator>
      <dc:date>2024-01-16T22:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: insufficient memory</title>
      <link>https://communities.sas.com/t5/New-SAS-User/insufficient-memory/m-p/911705#M40810</link>
      <description>&lt;P&gt;Run this to confirm your SAS MEMSIZE setting and post the results:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc options option = memsize;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Jan 2024 22:11:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/insufficient-memory/m-p/911705#M40810</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2024-01-16T22:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: insufficient memory</title>
      <link>https://communities.sas.com/t5/New-SAS-User/insufficient-memory/m-p/911711#M40811</link>
      <description>&lt;P&gt;Memory issues with the code and data you've posted? That shouldn't consume much memory. Here from a run on my laptop.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1705444932600.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/92566i682E99879B22D54F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_0-1705444932600.png" alt="Patrick_0-1705444932600.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your table A gets fully loaded into memory (only the key and data variables of course). In memory variables get fully expanded so should one of your data or key variables have a big length (like a description field) then memory consumption can grow quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also be aware that the memory available to a SAS session is per installation default limited to 2GB. You can check what applies for you by running:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc options group=memory;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 22:47:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/insufficient-memory/m-p/911711#M40811</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-01-16T22:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: insufficient memory</title>
      <link>https://communities.sas.com/t5/New-SAS-User/insufficient-memory/m-p/911729#M40812</link>
      <description>&lt;P&gt;If you were using stand alone (pc version) SAS ,you could make your sas have more memory .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1705456312505.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/92568iC8E9FDD0D599714C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1705456312505.png" alt="Ksharp_0-1705456312505.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_1-1705456640808.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/92569i351B6220233B5B0F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_1-1705456640808.png" alt="Ksharp_1-1705456640808.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_2-1705456700482.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/92570iC75A3BB98515109C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_2-1705456700482.png" alt="Ksharp_2-1705456700482.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2024 01:58:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/insufficient-memory/m-p/911729#M40812</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-01-17T01:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: insufficient memory</title>
      <link>https://communities.sas.com/t5/New-SAS-User/insufficient-memory/m-p/911733#M40814</link>
      <description>&lt;P&gt;What is the real size of your datasets (number of observations, number of variables used in the hash)?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2024 06:52:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/insufficient-memory/m-p/911733#M40814</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-01-17T06:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: insufficient memory</title>
      <link>https://communities.sas.com/t5/New-SAS-User/insufficient-memory/m-p/911739#M40815</link>
      <description>&lt;P&gt;I have 130 millions variables in dataset A. The same code works fine on sample record but it doesn't work on real dataset due to hug size.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Error log is -&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="ui-provider ee bcx bcy bcz bda bdb bdc bdd bde bdf bdg bdh bdi bdj bdk bdl bdm bdn bdo bdp bdq bdr bds bdt bdu bdv bdw bdx bdy bdz bea beb bec bed bee"&gt;WARNING: Multiple lengths were specified for the variable Employee_id by input data set(s). This can cause truncation of data.&lt;BR /&gt;ERROR: Hash object added 44040176 items when memory failure occurred.&lt;BR /&gt;FATAL: Insufficient memory to execute DATA step program. Aborted during the EXECUTION phase.&lt;BR /&gt;ERROR: The SAS System stopped processing this step because of insufficient memory.&lt;BR /&gt;WARNING: The data set WORK.WANT may be incomplete.&amp;nbsp; When this step was stopped there were 0 observations and 12 variables.&lt;BR /&gt;WARNING: Data set WORK.WANT was not replaced because this step was stopped.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1:00.24&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 40.14 seconds&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2024 09:13:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/insufficient-memory/m-p/911739#M40815</guid>
      <dc:creator>sanjaymane7</dc:creator>
      <dc:date>2024-01-17T09:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: insufficient memory</title>
      <link>https://communities.sas.com/t5/New-SAS-User/insufficient-memory/m-p/911747#M40816</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/296098"&gt;@sanjaymane7&lt;/a&gt;&amp;nbsp;Based on the log you shared you would need around 3 times the memory available to your SAS session in order to load your table into the hash. You need to talk to your SAS admin if that's feasible.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Log message "WARNING: Multiple lengths were specified for the variable Employee_id by input data set(s). This can cause truncation of data." indicates that variable employee_id is of type character in your real data. If you could shorten the length of the variable prior to loading into the hash then that should also save some memory - because it gets loaded as CHAR with all the trailing blanks consuming memory up to the full length of the variable.&amp;nbsp;&lt;BR /&gt;For the find() method you then could do something like:&amp;nbsp;&lt;SPAN&gt;if h.find(key:strip(Employee_Id),key:k)=0 then leave;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;...and...&lt;/P&gt;
&lt;P&gt;Is one or both of your source tables by any chance already sorted by employee_id?&lt;/P&gt;
&lt;P&gt;How many rows are in your real "table B"?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2024 10:32:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/insufficient-memory/m-p/911747#M40816</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-01-17T10:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: insufficient memory</title>
      <link>https://communities.sas.com/t5/New-SAS-User/insufficient-memory/m-p/911748#M40817</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/296098"&gt;@sanjaymane7&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would expect the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/hostwin/n0srij4mcdpzv2n1vtphltb00xjw.htm" target="_blank" rel="noopener"&gt;MEMSIZE&lt;/A&gt; adjustment suggested by others to solve the issue. In addition, you could reduce the memory requirement for the hash object, if needed: Your sample data (using 3*8=24 bytes plus overhead for the key and data items of one observation) suggest that &lt;FONT face="courier new,courier"&gt;Employee_ID&lt;/FONT&gt; and &lt;FONT face="courier new,courier"&gt;Date&lt;/FONT&gt; could be combined into a single 8-byte key. On my workstation the value of &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lecompobjref/p195co8u1s7a91n1xv1get0544t3.htm" target="_blank" rel="noopener"&gt;&lt;FONT face="courier new,courier"&gt;h.item_size&lt;/FONT&gt;&lt;/A&gt; drops from 64 to 48 by doing so. Abbreviating&amp;nbsp;&lt;FONT face="courier new,courier"&gt;Plan&lt;/FONT&gt;&amp;nbsp;to a 1-byte data item does not reduce this value further, though. What is the item size with your real data?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2024 10:36:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/insufficient-memory/m-p/911748#M40817</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2024-01-17T10:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: insufficient memory</title>
      <link>https://communities.sas.com/t5/New-SAS-User/insufficient-memory/m-p/911757#M40818</link>
      <description>&lt;P&gt;What are the lengths of employee_id and plan in dataset "A"? What is your MEMSIZE setting?&lt;/P&gt;
&lt;P&gt;And is your SAS running on your PC, or are you connecting to a server?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As a first step, make sure that employee_id is defined with the same length in all your datasets. Similarly, look at the contents of plan&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select max(length(plan)) from a;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to see if plan is properly defined there.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2024 10:41:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/insufficient-memory/m-p/911757#M40818</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-01-17T10:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: insufficient memory</title>
      <link>https://communities.sas.com/t5/New-SAS-User/insufficient-memory/m-p/911762#M40819</link>
      <description>&lt;P&gt;Length of employee id is 10 char in both table.&lt;/P&gt;
&lt;P&gt;I am using laptop with the following config - 32GB ram and 500 GB hard disk, processor -&amp;nbsp;Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz 1.99 GHz, system type -&amp;nbsp;64-bit operating system, x64-based processor.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2024 11:04:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/insufficient-memory/m-p/911762#M40819</guid>
      <dc:creator>sanjaymane7</dc:creator>
      <dc:date>2024-01-17T11:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: insufficient memory</title>
      <link>https://communities.sas.com/t5/New-SAS-User/insufficient-memory/m-p/911770#M40820</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/296098"&gt;@sanjaymane7&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Length of employee id is 10 char in both table.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Positively not. From your log:&lt;/P&gt;
&lt;PRE&gt;WARNING: Multiple lengths were specified for the variable Employee_id by input data set(s). This can cause truncation of data.&lt;/PRE&gt;
&lt;P&gt;This message will only appear when the variable is defined differently in the datasets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;I am using laptop with the following config - 32GB ram and 500 GB hard disk, processor -&amp;nbsp;Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz 1.99 GHz, system type -&amp;nbsp;64-bit operating system, x64-based processor.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That's what&amp;nbsp;&lt;EM&gt;you&lt;/EM&gt; use. But does your SAS use it (meaning that you have a fully local SAS installation)?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2024 12:40:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/insufficient-memory/m-p/911770#M40820</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-01-17T12:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: insufficient memory</title>
      <link>https://communities.sas.com/t5/New-SAS-User/insufficient-memory/m-p/911781#M40821</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;'s question about sort order is a good hint.&amp;nbsp; If your data are sorted by Employee_ID, then this can be changed&amp;nbsp; to an approach where you would hash in chunks.&amp;nbsp; For each ID, you would load the hash table with data for that Employee_ID, then do the look-ups for that ID.&amp;nbsp; With that approach, you only need enough memory to load the hash table for one ID.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, if work.A is sorted by ID and date, and if work.B is not huge, you could always make a new work.B with seven records per ID (one per each date), and then just merge that against work.A to do the lookup.&amp;nbsp; Part of the original genius of the DATA step is that it was built for computers with little memory, so MERGE doesn't care how many records you have.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yet another option would be to try a SQL join and see how the optimizer approaches the problem.&amp;nbsp; It would likely depend on the size of work.B.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2024 14:26:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/insufficient-memory/m-p/911781#M40821</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2024-01-17T14:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: insufficient memory</title>
      <link>https://communities.sas.com/t5/New-SAS-User/insufficient-memory/m-p/911783#M40822</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/296098"&gt;@sanjaymane7&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Length of employee id is 10 char in both table.&lt;/P&gt;
&lt;P&gt;I am using laptop with the following config - 32GB ram and 500 GB hard disk, processor -&amp;nbsp;Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz 1.99 GHz, system type -&amp;nbsp;64-bit operating system, x64-based processor.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The relevant bit is where SAS is installed and executes (not EG/Studio but the server you connect to). The specs of your laptop are only relevant if you connect to a locally installed SAS.&lt;/P&gt;
&lt;P&gt;IF you have a locally installed SAS then follow&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;'s recommendation and increase the max memsize that a SAS session can consume to something like 16GB.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2024 14:54:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/insufficient-memory/m-p/911783#M40822</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-01-17T14:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: insufficient memory</title>
      <link>https://communities.sas.com/t5/New-SAS-User/insufficient-memory/m-p/911791#M40823</link>
      <description>&lt;P&gt;I doubt that HASH is the way to go for this problem (even if you could force all of the data into memory).&amp;nbsp; That is because it looks like you want to find the plan that was in effect on a date.&amp;nbsp; Normally the information on plans has START/STOP dates and not a record for every date in the interval.&amp;nbsp; But a HASH object requires the keys to match exactly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A more efficient method would be to interleave the two datasets and remember the most recent plan that was in effect at the event date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So assuming that A represents when the subject started on a plan and B represents the event date (claim date) then something like this should work.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want2;
  set a(in=inplan) b(in=inevent);
  by employee_id date ;
  if inplan then do;
    lastplan=plan;
    lastdate=date;
  end;
  retain lastplan lastdate;
  if inevent and not first.employee_id then do;
    if date - 7 &amp;lt;= lastdate &amp;lt;= date then plan=lastplan;
    output;
  end;
  format lastdate yymmdd10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Which will produce slightly different results than your code which is looking for the NEXT plan they signed up for instead of the CURRENT plan they have.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1705505319063.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/92589i65F742F673729657/image-size/large?v=v2&amp;amp;px=999" role="button" title="Tom_0-1705505319063.png" alt="Tom_0-1705505319063.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2024 15:35:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/insufficient-memory/m-p/911791#M40823</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-01-17T15:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: insufficient memory</title>
      <link>https://communities.sas.com/t5/New-SAS-User/insufficient-memory/m-p/911801#M40824</link>
      <description>&lt;P&gt;And if you did want to search for the NEXT plan instead of the current plan then perhaps an ARRAY would be better.&lt;/P&gt;
&lt;P&gt;Use the DATE as the index into the array.&amp;nbsp; Make sure to define the array large enough for all possible event and plan dates (and don't forget about the extra 7 days).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want3;
  do until(last.employee_id);
    set a(in=inplan where=(not missing(date))) b(in=inevent) ;
    by employee_id  ;
    array plans [%sysfunc(mdy(1,1,2023)):%sysfunc(mdy(1,31,2024))] $8 ;
    drop plans: ;
    if inplan then do;
      plans[date]=plan; 
    end;
    if inevent then do;
      do k=date to date+7 until(not missing(plan));
        plan=plans[k];
      end;
      output;
    end;
  end;
  format k yymmdd10.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1705507012039.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/92591i80D67C5630A22543/image-size/large?v=v2&amp;amp;px=999" role="button" title="Tom_0-1705507012039.png" alt="Tom_0-1705507012039.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2024 16:16:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/insufficient-memory/m-p/911801#M40824</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-01-17T16:16:51Z</dc:date>
    </item>
  </channel>
</rss>

