<?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: PROC EXPORT to .txt taking too long in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-EXPORT-to-txt-taking-too-long/m-p/818863#M81876</link>
    <description>&lt;P&gt;Thanks for your great solution works great!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Paula&lt;/P&gt;</description>
    <pubDate>Fri, 17 Jun 2022 16:29:50 GMT</pubDate>
    <dc:creator>SASGeek</dc:creator>
    <dc:date>2022-06-17T16:29:50Z</dc:date>
    <item>
      <title>PROC EXPORT to .txt taking too long</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-EXPORT-to-txt-taking-too-long/m-p/818507#M81871</link>
      <description>Hello,&lt;BR /&gt;I have a SAS file of over 2m records (and growing) that takes 2 hrs + to create a .txt file. The code is basic&lt;BR /&gt;proc export data=work.cust_data&lt;BR /&gt;outfile= "c:\cust_data.txt"&lt;BR /&gt;dbms=tab&lt;BR /&gt;replace;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;Are we stuck with the 2 hr wait time or is there something we can change ? If so, please provide example.&lt;BR /&gt;&lt;BR /&gt;Thank you&lt;BR /&gt;&lt;BR /&gt;Paula</description>
      <pubDate>Thu, 16 Jun 2022 01:29:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-EXPORT-to-txt-taking-too-long/m-p/818507#M81871</guid>
      <dc:creator>SASGeek</dc:creator>
      <dc:date>2022-06-16T01:29:21Z</dc:date>
    </item>
    <item>
      <title>Re: PROC EXPORT to .txt taking too long</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-EXPORT-to-txt-taking-too-long/m-p/818508#M81872</link>
      <description>&lt;P&gt;Where are you running this? On a PC or on a remote SAS server? If it is on a PC then you will be limited by the IO performance of your disk drive. Please note that if your PC only has one disk drive then it will be doing both the reading and writing of the data at the same time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please post the SAS log of your PROC EXPORT program step. If there is a big difference between the real time and CPU time reported, then IO is the likely culprit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One option would be to split the SAS dataset in two and process each half in two SAS sessions / jobs running at the same time. That should cut your time nearly in half. The disadvantage is that you will end up with two tab-delimited files.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 01:48:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-EXPORT-to-txt-taking-too-long/m-p/818508#M81872</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-06-16T01:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: PROC EXPORT to .txt taking too long</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-EXPORT-to-txt-taking-too-long/m-p/818509#M81873</link>
      <description>&lt;P&gt;How many variables?&lt;/P&gt;
&lt;P&gt;Does whatever you use the export for require all the variables?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you export to a remote drive, cloud or similar you also may run into any bottleneck imposed by that communication or network bandwidth.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 02:02:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-EXPORT-to-txt-taking-too-long/m-p/818509#M81873</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-06-16T02:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: PROC EXPORT to .txt taking too long</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-EXPORT-to-txt-taking-too-long/m-p/818510#M81874</link>
      <description>&lt;P&gt;PROC EXPORT is reasonably efficient.&amp;nbsp;&lt;STRONG&gt; I suspect the real issue is the disk where you are writing the text file.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you are writing the same file over and over you could eliminate the small amount of overhead that PROC EXPORT does add and just write your own data step to write the file instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you don't need to header line it is very trivial.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  set cust_data;
  file "c:\cust_data.txt" dsd dlm='09'x ;
  put (_all_) (+0);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you do need to include the header line it is trivial if the structure never changes.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  set cust_data;
  file "c:\cust_data.txt" dsd dlm='09'x ;
  if _n_=1 then put 'var1' '09'x 'var2' ..... ;
  put (_all_) (+0);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And if it does change it does not really add much either.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=cust_data(obs=0) out=names;
  var _all_;
run;
data _null_;
  set names ; 
  file "c:\cust_data.txt" dsd dlm='09'x ;
  put _name_ @;
run;
data _null_;
  set cust_data;
  file "c:\cust_data.txt" dsd dlm='09'x mod ;
  put (_all_) (+0);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 02:32:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-EXPORT-to-txt-taking-too-long/m-p/818510#M81874</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-06-16T02:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: PROC EXPORT to .txt taking too long</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-EXPORT-to-txt-taking-too-long/m-p/818511#M81875</link>
      <description>&lt;P&gt;Maybe instead of writing the entire set use a data step to write to the existing file with MOD option and use the OBS= data set option on the SET statement to only include the "new" observations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of course, if you are adding variables or changing values of the already ready variables this isn't possible.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jun 2022 02:39:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-EXPORT-to-txt-taking-too-long/m-p/818511#M81875</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-06-16T02:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: PROC EXPORT to .txt taking too long</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-EXPORT-to-txt-taking-too-long/m-p/818863#M81876</link>
      <description>&lt;P&gt;Thanks for your great solution works great!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Paula&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jun 2022 16:29:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-EXPORT-to-txt-taking-too-long/m-p/818863#M81876</guid>
      <dc:creator>SASGeek</dc:creator>
      <dc:date>2022-06-17T16:29:50Z</dc:date>
    </item>
  </channel>
</rss>

