<?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 error for processing large datasets in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Insufficient-memory-error-for-processing-large-datasets/m-p/48386#M13090</link>
    <description>I might question your BUFNO=MAX setting.  Also, you don't mention MEMSIZE= in your list.&lt;BR /&gt;
&lt;BR /&gt;
You will want to contact SAS Tech Support for further assistance with your situation.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
    <pubDate>Tue, 13 Jul 2010 16:18:18 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2010-07-13T16:18:18Z</dc:date>
    <item>
      <title>Insufficient memory error for processing large datasets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Insufficient-memory-error-for-processing-large-datasets/m-p/48383#M13087</link>
      <description>Hi all, &lt;BR /&gt;
&lt;BR /&gt;
Summary of problems occurred in my job: &lt;BR /&gt;
&lt;BR /&gt;
If we take the log just before the first (Insufficient memory)  error : &lt;BR /&gt;
NOTE: Renaming a table ...                                                     &lt;BR /&gt;
MPRINT(CALL_INBOUND_JOB):   proc datasets lib = work nolist nowarn memtype = ( &lt;BR /&gt;
MPRINT(CALL_INBOUND_JOB):   change etls_M601CR_FR = M601CR_FR;                 &lt;BR /&gt;
MPRINT(CALL_INBOUND_JOB):   quit;                                             &lt;BR /&gt;
                                                                              &lt;BR /&gt;
NOTE: Changing the name WORK.ETLS_M601CR_FR to WORK.M601CR_FR (memtype=DATA). &lt;BR /&gt;
NOTE: The PROCEDURE DATASETS used the following resources:                     &lt;BR /&gt;
BOTTOM OF PAGE 000000032 ----------------------------------------------------- &lt;BR /&gt;
30 The SAS System                                                             &lt;BR /&gt;
                                                                              &lt;BR /&gt;
      CPU     time -         00:00:00.00                                       &lt;BR /&gt;
      Elapsed time -         00:00:00.02                                       &lt;BR /&gt;
      EXCP count   - 10                                                       &lt;BR /&gt;
      Task  memory - 471K (40K data, 431K program)                             &lt;BR /&gt;
      Total memory - 10001K (4896K data, 5105K program)                       &lt;BR /&gt;
NOTE: The address space has used a maximum of 3256K below the line and 15052K above the limit &lt;BR /&gt;
&lt;BR /&gt;
And then comes &lt;BR /&gt;
&lt;BR /&gt;
MPRINT(CHK_EXCESS_TXTLINE):   proc sql noprint;                               &lt;BR /&gt;
MPRINT(CHK_EXCESS_TXTLINE):   SELECT DISTINCT TRANS_ID INTO :mv_List_Trans_Id &lt;BR /&gt;
((EXCESS_052_FLG = 1 OR EXCESS_062_FLG = 1 ) AND REC_TYP IN ('052', '062')) ; &lt;BR /&gt;
NOTE: No rows were selected.                                                   &lt;BR /&gt;
MPRINT(CHK_EXCESS_TXTLINE):   quit;                                           &lt;BR /&gt;
NOTE: The PROCEDURE SQL used the following resources:                         &lt;BR /&gt;
      CPU     time -         00:00:44.50                                       &lt;BR /&gt;
      Elapsed time -         00:01:15.43                                       &lt;BR /&gt;
      EXCP count   - 111                                                       &lt;BR /&gt;
      Task  memory - 1085K (0K data, 1085K program)                           &lt;BR /&gt;
      Total memory - 784771K (779060K data, 5711K program)                     &lt;BR /&gt;
NOTE: The address space has used a maximum of 4908K below the line and 786628K &lt;BR /&gt;
&lt;BR /&gt;
And then the insufficient memory error comes. &lt;BR /&gt;
&lt;BR /&gt;
MPRINT(CALL_INBOUND_JOB):  ;                                                   &lt;BR /&gt;
MPRINT(CHK_CUST_NO):   proc sql noprint;                                       &lt;BR /&gt;
MPRINT(CHK_CUST_NO):   SELECT TRANS_ID into :mv_List_Trans_Id_1 SEPARATED by ',' FROM ( SELECT DISTINCT TRANS_ID, CRED_CUST_NO, 1 &lt;BR /&gt;
AS CNT FROM Work.M601CR_FR WHERE REC_TYP IN ('022', '042', '052', '062') ) GROUP BY TRANS_ID HAVING SUM(CNT) &amp;gt; 1 ; &lt;BR /&gt;
NOTE: SAS threaded sort was used.                                               &lt;BR /&gt;
ERROR: Insufficient memory.                                                     &lt;BR /&gt;
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of state &lt;BR /&gt;
MPRINT(CHK_CUST_NO):   quit;                                                   &lt;BR /&gt;
NOTE: The SAS System stopped processing this step because of errors.           &lt;BR /&gt;
NOTE: The PROCEDURE SQL used the following resources:                           &lt;BR /&gt;
      CPU     time -         00:01:09.06                                       &lt;BR /&gt;
      Elapsed time -         00:02:06.13                                       &lt;BR /&gt;
      EXCP count   - 14958                                                     &lt;BR /&gt;
      Task  memory - 1253K (0K data, 1253K program)                             &lt;BR /&gt;
      Total memory - 785579K (779700K data, 5879K program)                     &lt;BR /&gt;
NOTE: The address space has used a maximum of 4912K below the line and 791356K &lt;BR /&gt;
&lt;BR /&gt;
Before and inclusive the step of  "renaming table" (the first entry I have listed), - the storage usage above the limit has been no more than 15MB (in fact for many procedures/steps it has been steady on 15052K). &lt;BR /&gt;
Then  comes the "MPRINT(CHK_EXCESS_TXTLINE):   proc sql noprint" with the select statement which in fact returns ZERO rows, &lt;BR /&gt;
but as you can see returning ZERO rows results in an storage increase from the (steady) 15052K to around 780MB &lt;BR /&gt;
&lt;BR /&gt;
Still not an error, - but as you can see the next step kind of builds on top of the storage allocated, - and after the "Insufficient memory" message the storage allocation is now around 790MB. &lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;So the question is, - should there be somehow a built-in command to release storage after the procedure/step resulting in ZERO rows ?.  Does the application miss to do this because ZERO rows returned triggers another code logic path ?.&lt;/B&gt;</description>
      <pubDate>Tue, 13 Jul 2010 13:36:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Insufficient-memory-error-for-processing-large-datasets/m-p/48383#M13087</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-07-13T13:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: Insufficient memory error for processing large datasets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Insufficient-memory-error-for-processing-large-datasets/m-p/48384#M13088</link>
      <description>First of all, your SAS log is truncated.  Second, the two PROC SQL invocations have different WHERE specifications.  Suggest you test your code with a more limiting WHERE clause in the second PROC SQL execution.  Also check your SAS OPTIONS settings for GROUP=MEMORY, with PROC OPTIONS.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Tue, 13 Jul 2010 14:05:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Insufficient-memory-error-for-processing-large-datasets/m-p/48384#M13088</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-07-13T14:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: Insufficient memory error for processing large datasets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Insufficient-memory-error-for-processing-large-datasets/m-p/48385#M13089</link>
      <description>Hi Scott,&lt;BR /&gt;
&lt;BR /&gt;
The where conditions cant be modified as per functional requirement.&lt;BR /&gt;
I wanted to know is there any SAS options that can release the program memory of the step after it is executed successfully.&lt;BR /&gt;
Also the options used are:&lt;BR /&gt;
MEMLEAVE=256M                                                   &lt;BR /&gt;
PROCLEAVE=(2M,2M)                                                &lt;BR /&gt;
SYSLEAVE=(512K,512K)&lt;BR /&gt;
compress=yes reuse=yes STATS MEMRPT FULLSTIMER MSGLEVEL=I bufsize=512K &lt;BR /&gt;
bufno=MAX SORTSIZE=MAX UBUFNO = 20&lt;BR /&gt;
&lt;BR /&gt;
Rest are default system options. The SAS server is 9.1 on z/OS&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: Pratik

Message was edited by: Pratik</description>
      <pubDate>Tue, 13 Jul 2010 14:21:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Insufficient-memory-error-for-processing-large-datasets/m-p/48385#M13089</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-07-13T14:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: Insufficient memory error for processing large datasets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Insufficient-memory-error-for-processing-large-datasets/m-p/48386#M13090</link>
      <description>I might question your BUFNO=MAX setting.  Also, you don't mention MEMSIZE= in your list.&lt;BR /&gt;
&lt;BR /&gt;
You will want to contact SAS Tech Support for further assistance with your situation.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Tue, 13 Jul 2010 16:18:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Insufficient-memory-error-for-processing-large-datasets/m-p/48386#M13090</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-07-13T16:18:18Z</dc:date>
    </item>
  </channel>
</rss>

