<?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: Is there a way to test if SASFILE will fail before trying to open data set larger than memory. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-test-if-SASFILE-will-fail-before-trying-to/m-p/836040#M330572</link>
    <description>&lt;P&gt;sashelp.vtable has the size of all datasets available in the session. Try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   set sashelp.vtable;
   where libname = 'LIB' and memname = 'XYZ';
   memsize = input(getOption('memsize'), best.);
   
   if filesize &amp;lt; memsize then do;
      call execute('sasfile lib.xyz open;');
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 30 Sep 2022 10:55:07 GMT</pubDate>
    <dc:creator>andreas_lds</dc:creator>
    <dc:date>2022-09-30T10:55:07Z</dc:date>
    <item>
      <title>Is there a way to test if SASFILE will fail before trying to open data set larger than memory.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-test-if-SASFILE-will-fail-before-trying-to/m-p/836027#M330562</link>
      <description>&lt;P&gt;I run code in a SAS Server that give the session 4GB of RAM (MEMSIZE=4,294,967,296).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A program is being developed that will act on a data set many times and the SASFILE statement is being used to speed up the repeated uses of the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;SASFILE LIB.XYZ OPEN&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem is that sometimes the data set is larger than 4GB.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a reliable way to test if SASFILE will fail?&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In exploring this question I made a sandbox session with far less memory (128MB) to see logging and macro variables in low memory situations&lt;/P&gt;
&lt;PRE&gt;C:\Program Files\SASHome\SASFoundation\9.4\sas.exe -sasuser c:\temp\sasuser -memsize 128MB&lt;/PRE&gt;
&lt;P&gt;and this program to create an outsized data set for the session and attempt to SASFILE it&lt;/P&gt;
&lt;PRE&gt;data x;
  set sashelp.cars;
  do _n_ = 1 to 2500;
    output;
  end;
run;

sasfile work.x open;
%put _all_;
sasfile work.x close;
&lt;/PRE&gt;
&lt;P&gt;A first run of the code logs an out of memory&lt;/P&gt;
&lt;PRE&gt;8    sasfile work.x open;
WARNING: Out of memory.
9    %put &amp;amp;=SYSWARNINGTEXT;
SYSWARNINGTEXT=Out of memory.
10   %put &amp;amp;=SYSERRORTEXT;
SYSERRORTEXT=
11   sasfile work.x close;
NOTE: The file WORK.X.DATA has been closed by the SASFILE statement.
&lt;/PRE&gt;
&lt;P&gt;The SYSWARNINGTEXT is just about the only useful info, however, there is no way to reset the warning text for later tests&lt;/P&gt;
&lt;P&gt;If the warning goes unheeded and a DATA step involving the oversized file the system fails the step and limps along in a state I would not trust, such as continued steps can't continue because the LOG window is clogged (The LOG window must grab a fair amount of.RAM for itself)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 09:51:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-test-if-SASFILE-will-fail-before-trying-to/m-p/836027#M330562</guid>
      <dc:creator>RichardDeVen</dc:creator>
      <dc:date>2022-09-30T09:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to test if SASFILE will fail before trying to open data set larger than memory.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-test-if-SASFILE-will-fail-before-trying-to/m-p/836032#M330565</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;none I know of, but a workaround could be to &lt;A href="https://v8doc.sas.com/sashtml/cms/zas-size.htm" target="_blank" rel="noopener"&gt;estimate the dataset size&lt;/A&gt; before a memory load?&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 10:22:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-test-if-SASFILE-will-fail-before-trying-to/m-p/836032#M330565</guid>
      <dc:creator>Oligolas</dc:creator>
      <dc:date>2022-09-30T10:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to test if SASFILE will fail before trying to open data set larger than memory.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-test-if-SASFILE-will-fail-before-trying-to/m-p/836040#M330572</link>
      <description>&lt;P&gt;sashelp.vtable has the size of all datasets available in the session. Try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   set sashelp.vtable;
   where libname = 'LIB' and memname = 'XYZ';
   memsize = input(getOption('memsize'), best.);
   
   if filesize &amp;lt; memsize then do;
      call execute('sasfile lib.xyz open;');
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 30 Sep 2022 10:55:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-test-if-SASFILE-will-fail-before-trying-to/m-p/836040#M330572</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-09-30T10:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to test if SASFILE will fail before trying to open data set larger than memory.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-test-if-SASFILE-will-fail-before-trying-to/m-p/836110#M330607</link>
      <description>&lt;P&gt;N1ce that should do the trick&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 15:26:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-test-if-SASFILE-will-fail-before-trying-to/m-p/836110#M330607</guid>
      <dc:creator>Oligolas</dc:creator>
      <dc:date>2022-09-30T15:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to test if SASFILE will fail before trying to open data set larger than memory.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-test-if-SASFILE-will-fail-before-trying-to/m-p/836122#M330610</link>
      <description>&lt;P&gt;It's hack, but while you can't write to SYSWARNINGTEXT, if you write a WARNING: note to the log, looks like SAS will update the value:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;1    %put WARNING: Out of memory ;
WARNING: Out of memory
2    %put &amp;amp;=syswarningtext ;
SYSWARNINGTEXT=Out of memory
3
4    %put WARNING: %str( ) ;
WARNING:
5    %put &amp;amp;=syswarningtext ;
SYSWARNINGTEXT=
&lt;/PRE&gt;</description>
      <pubDate>Fri, 30 Sep 2022 15:50:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-way-to-test-if-SASFILE-will-fail-before-trying-to/m-p/836122#M330610</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2022-09-30T15:50:50Z</dc:date>
    </item>
  </channel>
</rss>

