<?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 Proc Sort causing my temporary file burst my storage in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Sort-causing-my-temporary-file-burst-my-storage/m-p/171550#M301514</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, as per my question above. I'm using SQL dataware house and doing query through ODBC. &lt;/P&gt;&lt;P&gt;When it run until the second part of the code which is sorting the dataset, the temp file getting bigger and bigger until burst my storage.&lt;/P&gt;&lt;P&gt;Anyone know what is the issue? Thank you.&lt;/P&gt;&lt;P&gt;My code as below.&lt;/P&gt;&lt;P&gt;Where the create date and complete date is in Datetime22.3 format and the number of observation around 13 million and my available storage around 70GB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;LIBNAME NEDGLOR&lt;/TD&gt;&lt;TD&gt;ODBC&lt;/TD&gt;&lt;TD&gt;DATASRC=NEDGLOR&lt;/TD&gt;&lt;TD&gt;SCHEMA=DBO;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt; CREATE TABLE SASUSER.TBL_WF_ST_ACT_USER AS SELECT &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt; PRO_ID,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt; CREATE_DATE,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt; ACT_DEF_NAME,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt; APP_STATUS_CODE,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt; COMPLETE_DATE,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt; CUSTOM_COLUMN1 &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt; FROM NEDGLOR.TBL_WF_ST_ACT_USER&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SORT DATA=TBL_WF_ST_ACT_USER; BY PRO_ID DESCENDING CREATE DATE DESCENDING ACT_DEF_NAME; RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Jan 2015 06:36:42 GMT</pubDate>
    <dc:creator>SASuserMY</dc:creator>
    <dc:date>2015-01-07T06:36:42Z</dc:date>
    <item>
      <title>Proc Sort causing my temporary file burst my storage</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Sort-causing-my-temporary-file-burst-my-storage/m-p/171550#M301514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, as per my question above. I'm using SQL dataware house and doing query through ODBC. &lt;/P&gt;&lt;P&gt;When it run until the second part of the code which is sorting the dataset, the temp file getting bigger and bigger until burst my storage.&lt;/P&gt;&lt;P&gt;Anyone know what is the issue? Thank you.&lt;/P&gt;&lt;P&gt;My code as below.&lt;/P&gt;&lt;P&gt;Where the create date and complete date is in Datetime22.3 format and the number of observation around 13 million and my available storage around 70GB.&lt;/P&gt;&lt;P&g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description>
      <pubDate>Wed, 07 Jan 2015 06:36:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Sort-causing-my-temporary-file-burst-my-storage/m-p/171550#M301514</guid>
      <dc:creator>SASuserMY</dc:creator>
      <dc:date>2015-01-07T06:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Sort causing my temporary file burst my storage</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Sort-causing-my-temporary-file-burst-my-storage/m-p/171551#M301515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure but try this ==&amp;gt;&amp;nbsp; OPTION COMPRESS = YES RESUE=YES;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;LIBNAME NEDGLOR&lt;/TD&gt;&lt;TD&gt;ODBC&lt;/TD&gt;&lt;TD&gt;DATASRC=NEDGLOR&lt;/TD&gt;&lt;TD&gt;SCHEMA=DBO;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt; OPTION COMPRESS = YES RESUE=YES;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;CREATE TABLE SASUSER.TBL_WF_ST_ACT_USER AS SELECT &lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;PRO_ID,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;CREATE_DATE,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;ACT_DEF_NAME,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;APP_STATUS_CODE,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;COMPLETE_DATE,&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;CUSTOM_COLUMN1 &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;FROM NEDGLOR.TBL_WF_ST_ACT_USER&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SORT DATA=TBL_WF_ST_ACT_USER; BY PRO_ID DESCENDING CREATE DATE DESCENDING ACT_DEF_NAME; RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2015 07:55:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Sort-causing-my-temporary-file-burst-my-storage/m-p/171551#M301515</guid>
      <dc:creator>TarunKumar</dc:creator>
      <dc:date>2015-01-07T07:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Sort causing my temporary file burst my storage</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Sort-causing-my-temporary-file-burst-my-storage/m-p/171552#M301516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you have an database-query being executed than DO NOT sort in SAS but retrieve the dataset ordered (SQL ordered by clause).&lt;/P&gt;&lt;P&gt;When it is possible have the RDBMS execute as much as possible and do not copy the data back to SAS for ease of coding too quickly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it required to copy data to the SAS environment have it compressed in the best possible way (compress=binary) for saving size and also IO time with spinning disks.&lt;/P&gt;&lt;P&gt;The Sort/utility files are not affected by compressing and will not help with that.&lt;/P&gt;&lt;P&gt;Even the bufsize en bufno were not tunable with utility-files before 9.4&amp;nbsp; &lt;A href="http://support.sas.com/documentation/cdl/en/lesysoptsref/67465/HTML/default/viewer.htm#n12mugp7qkqgein1nb2zidy3sals.htm" title="http://support.sas.com/documentation/cdl/en/lesysoptsref/67465/HTML/default/viewer.htm#n12mugp7qkqgein1nb2zidy3sals.htm"&gt;SAS(R) 9.4 System Options: Reference, Third Edition&lt;/A&gt; (ubufsize ubufno)&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2015 09:06:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Sort-causing-my-temporary-file-burst-my-storage/m-p/171552#M301516</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2015-01-07T09:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Sort causing my temporary file burst my storage</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Sort-causing-my-temporary-file-burst-my-storage/m-p/171553#M301517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is totally a SAS thing, so your SQL Server/ODBC connection takes no part.&lt;/P&gt;&lt;P&gt;For a normal sort, you need to have 3 times the size of the source table available + the size for the target table.&lt;/P&gt;&lt;P&gt;A few things that you could test:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Use Order By in your SQL. Chances are that the sort will be pushed down to your SQL Server.&lt;/LI&gt;&lt;LI&gt;Expand your WORK directory&lt;/LI&gt;&lt;LI&gt;Expand your MEMSIZE ans SORTSIZE system options.&lt;/LI&gt;&lt;LI&gt;Use TAGSORT in PROC SORT. Takes quite longer time, but uses less memory.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I guess this is just a small code snippet, but consider not to move your data to SAS, it's just a sort...?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Jan 2015 09:29:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Sort-causing-my-temporary-file-burst-my-storage/m-p/171553#M301517</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2015-01-07T09:29:16Z</dc:date>
    </item>
  </channel>
</rss>

