<?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: Loading data from ODBC cloud server extremely slow in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Loading-data-from-ODBC-cloud-server-extremely-slow/m-p/601637#M18345</link>
    <description>&lt;P&gt;Thanks for the ideas. I also discovered some of the variables were stored as massive strings (1000+ characters). I can't imagine that helps with processing time...&lt;/P&gt;</description>
    <pubDate>Tue, 05 Nov 2019 11:58:38 GMT</pubDate>
    <dc:creator>MB_Analyst</dc:creator>
    <dc:date>2019-11-05T11:58:38Z</dc:date>
    <item>
      <title>Loading data from ODBC cloud server extremely slow</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Loading-data-from-ODBC-cloud-server-extremely-slow/m-p/601625#M18343</link>
      <description>&lt;P&gt;I'm connecting to a database hosted somewhere in the cloud, via an ODBC LIBNAME statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I try to load the data into memory with a DATA step, it takes around 4 minutes to bring in ~25,000 observations. Is this slower than expected? Is there a method I can use that makes bringing the data into my WORK folder faster? Would using a hash table speed this up, or are hash tables more useful for joins?&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA want;
    set cloud.have (keep=id and other vars)
    where year &amp;gt;= 2019;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Nov 2019 11:15:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Loading-data-from-ODBC-cloud-server-extremely-slow/m-p/601625#M18343</guid>
      <dc:creator>MB_Analyst</dc:creator>
      <dc:date>2019-11-05T11:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: Loading data from ODBC cloud server extremely slow</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Loading-data-from-ODBC-cloud-server-extremely-slow/m-p/601632#M18344</link>
      <description>&lt;P&gt;Look at the speed of your network connection.&lt;/P&gt;
&lt;P&gt;It might also be that the execution of your where condition takes too much time because no index is defined for year.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For diagnostic purposes, have the select run natively on the database for comparison.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 11:50:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Loading-data-from-ODBC-cloud-server-extremely-slow/m-p/601632#M18344</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-11-05T11:50:44Z</dc:date>
    </item>
    <item>
      <title>Re: Loading data from ODBC cloud server extremely slow</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Loading-data-from-ODBC-cloud-server-extremely-slow/m-p/601637#M18345</link>
      <description>&lt;P&gt;Thanks for the ideas. I also discovered some of the variables were stored as massive strings (1000+ characters). I can't imagine that helps with processing time...&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 11:58:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Loading-data-from-ODBC-cloud-server-extremely-slow/m-p/601637#M18345</guid>
      <dc:creator>MB_Analyst</dc:creator>
      <dc:date>2019-11-05T11:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: Loading data from ODBC cloud server extremely slow</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Loading-data-from-ODBC-cloud-server-extremely-slow/m-p/601651#M18347</link>
      <description>&lt;P&gt;Try option:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;libname cloud ODBC ......&amp;nbsp; readbuff=10000 ;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 12:59:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Loading-data-from-ODBC-cloud-server-extremely-slow/m-p/601651#M18347</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-11-05T12:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: Loading data from ODBC cloud server extremely slow</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Loading-data-from-ODBC-cloud-server-extremely-slow/m-p/601765#M18349</link>
      <description>&lt;P&gt;Test a row count from your ODBC connection:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
  select count(*)
  from cloud.have
  where year &amp;gt;= 2019;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If this runs a lot faster then you can conclude your network connection is what is slowing you down.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 19:09:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Loading-data-from-ODBC-cloud-server-extremely-slow/m-p/601765#M18349</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-11-05T19:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: Loading data from ODBC cloud server extremely slow</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Loading-data-from-ODBC-cloud-server-extremely-slow/m-p/601779#M18351</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/182623"&gt;@MB_Analyst&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks for the ideas. I also discovered some of the variables were stored as massive strings (1000+ characters). I can't imagine that helps with processing time...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Network throughput is often the bottleneck and the length of the variables will impact on performance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you know that the variable lengths are too big then you could reduce them on the DB side before transferring the data over the network. This would certainly work with explicit SQL pass-through but you could also give below code a try.&lt;/P&gt;
&lt;P&gt;I'm not sure if SAS will push the length definition to the database so you'll have to check in the log how the actual SQL sent to the DB looked like (the options posted will create such SAS log information).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options sastrace='d' sastraceloc=saslog nostsuffix;
proc sql;
  create table want as
    select
      c.id,
      strip(c.varLen1000) as varLen length=$100,
      ....
    from cloud.have c
    where c.year &amp;gt;= 2019
    ;
quit&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Nov 2019 20:05:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Loading-data-from-ODBC-cloud-server-extremely-slow/m-p/601779#M18351</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-11-05T20:05:02Z</dc:date>
    </item>
    <item>
      <title>Re: Loading data from ODBC cloud server extremely slow</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Loading-data-from-ODBC-cloud-server-extremely-slow/m-p/601785#M18352</link>
      <description>&lt;P&gt;Massive strings may be handled by adding this option to your LIBNAME statement:&lt;/P&gt;
&lt;H1 class="xis-title" id="n1aqglg4ftdj04n1eyvh2l3367ql" style="box-sizing: border-box; color: inherit; font-family: inherit; font-size: 1.42rem; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.1; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; margin: 1em 0px 10px 0px;"&gt;&lt;A href="https://go.documentation.sas.com/?docsetId=acreldb&amp;amp;docsetTarget=n1aqglg4ftdj04n1eyvh2l3367ql.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;DBMAX_TEXT= LIBNAME Option&lt;/A&gt;&lt;/H1&gt;
&lt;P class="xis-shortDescription" style="border-top-color: #d1d5db; border-top-style: solid; border-top-width: 2px; box-sizing: border-box; color: #333333; font-family: &amp;amp;quot; avenirnext&amp;amp;quot;,helvetica,arial,sans-serif; font-size: 14.06px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; orphans: 2; padding-top: 0.7em; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; margin: 0px 0px 0.2em 0px;"&gt;Determines the length of any very long DBMS character data type, such as BLOB or CLOB, that is read into SAS or written from SAS when using a &lt;SPAN class="xis-nobr" style="box-sizing: border-box; white-space: nowrap;"&gt;SAS/ACCESS&lt;/SPAN&gt; engine.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 20:04:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Loading-data-from-ODBC-cloud-server-extremely-slow/m-p/601785#M18352</guid>
      <dc:creator>reprui</dc:creator>
      <dc:date>2019-11-05T20:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Loading data from ODBC cloud server extremely slow</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Loading-data-from-ODBC-cloud-server-extremely-slow/m-p/601788#M18353</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37300"&gt;@reprui&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That's to define the max string length exchangeable between SAS and a DB and to avoid truncation for long strings. It has no impact on performance (unless there is string truncation).&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2019 20:15:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Loading-data-from-ODBC-cloud-server-extremely-slow/m-p/601788#M18353</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-11-05T20:15:46Z</dc:date>
    </item>
    <item>
      <title>Re: Loading data from ODBC cloud server extremely slow</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Loading-data-from-ODBC-cloud-server-extremely-slow/m-p/602373#M18367</link>
      <description>&lt;P&gt;Agreed in some context...However, I've seen multiple applications of this in customer use cases where it does impact performance.&amp;nbsp; Especially when leveraging in-database PROC's (e.g., MEANS, TABULATE, FREQ, REPORT, PRINT).&amp;nbsp; During the "READ" operation is where this occurs.&amp;nbsp; Also, connecting via a Libname in EG (or other SAS UI) and viewing Hadoop data&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #333333; cursor: text; font-family: 'HelevticaNeue-light','Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt; (for example)&lt;/SPAN&gt; that has 32767 byte columns will lock your session even if it is only one column.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of course the optimal "best practice" is to format the data at its source properly and not leave it to be defined by a default value of STRING and without a column width specification.&amp;nbsp; Typically this requires the Data Management team to be more intentional about data quality.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem can also be solved by creating well structured "Views" of the data if the source tables cannot be modified.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are some additional links that discuss relevant topics:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/?docsetId=acreldb&amp;amp;docsetTarget=n1v1cfazem7dejn1xiq60o8zd45g.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: inherit; font-family: inherit; font-size: 1.42rem; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.1; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;Performance Considerations&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/?docsetId=acreldb&amp;amp;docsetTarget=p1f9ovbl1ifskpn1e82nky8v5bbb.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: inherit; font-family: inherit; font-size: 1.42rem; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 1.1; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;Optimizing Your SQL Usage&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Nov 2019 13:25:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Loading-data-from-ODBC-cloud-server-extremely-slow/m-p/602373#M18367</guid>
      <dc:creator>reprui</dc:creator>
      <dc:date>2019-11-07T13:25:00Z</dc:date>
    </item>
  </channel>
</rss>

