<?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: Requesting help with speed in reading DB2 tables? in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590182#M18054</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp; - To properly test DB2 connection performance you will need to learn to define your own database connections so you can experiment with different options. Just look at the Properties of your existing DB2 connections to figure out how to do this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest you also need to try SQL passthru where you can be sure everything is running the database. Just all part of the learning process for using external databases!&lt;/P&gt;</description>
    <pubDate>Thu, 19 Sep 2019 20:08:08 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2019-09-19T20:08:08Z</dc:date>
    <item>
      <title>Requesting help with speed in reading DB2 tables?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/589993#M18045</link>
      <description>&lt;P&gt;Hello Folks,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My team and I have a task in reading DB2 tables for a process. I am not sure how the architecture is set up. Basically, I have been given access to read DB2 tables with a libname. And the following took&lt;/P&gt;
&lt;PRE&gt;23         data temp17_ar_1 ;
24         set potbnd.ar(keep=src_stm_id) ;
25         where src_stm_id in (1,30,42,48,49);
26         run;

NOTE: There were 55749594 observations read from the data set POTBND.AR.
NOTE: The data set WORK.TEMP17_AR_1 has 12757931 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           25:29.08
      cpu time            5:46.61
&lt;/PRE&gt;
&lt;P&gt;Okay, some of you may think that's fine. I hope you don't. I was once&amp;nbsp; part of short term project where there was a need a access DB2 tables in a different organisation. The table sizes are comparable to the one I am currently reading. However, The execution took less than half the time. Come on, we can do better here too. Please advice. Thank you &amp;amp; Regards!&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 12:04:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/589993#M18045</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-09-19T12:04:09Z</dc:date>
    </item>
    <item>
      <title>Re: Requesting help with speed in reading DB2 tables?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/589997#M18046</link>
      <description>&lt;P&gt;First of all, it seems that the where condition is not handed off to the DB.&lt;/P&gt;
&lt;P&gt;And then you need to check observation numbers * observation size against the available network bandwidth between the servers.&lt;/P&gt;
&lt;P&gt;After all, 4 fifths of the time SAS was waiting for data.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 12:21:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/589997#M18046</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-09-19T12:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: Requesting help with speed in reading DB2 tables?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590000#M18047</link>
      <description>&lt;P&gt;Thank you Sir&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp; for the response. I might sound silly and dumb as I admit I have no knowledge on this. Henceforth, I request your patience. However, I am gonna consolidate your points and hopefully other's(who may chime) in this thread and take it forward to the authorities concerned&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BD2 tables of interest. Proc contents isn;t giving me the needed metadata info. So i did a&amp;nbsp;&lt;/P&gt;
&lt;P&gt;select count(*) and got this&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="99"&gt;
&lt;P&gt;&lt;STRONG&gt;POTBND DB2 Tables&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="197"&gt;
&lt;P&gt;&lt;STRONG&gt;Record_count&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="99"&gt;
&lt;P&gt;AR&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="197"&gt;
&lt;P&gt;55,749,594&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="99"&gt;
&lt;P&gt;AR_TVR_PRFL&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="197"&gt;
&lt;P&gt;13,984,214&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="99"&gt;
&lt;P&gt;AR_X_AR&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="197"&gt;
&lt;P&gt;15,977,287&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="99"&gt;
&lt;P&gt;FNC_SVC_AR&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="197"&gt;
&lt;P&gt;21,052,845&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="99"&gt;
&lt;P&gt;MSR_PRD&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="197"&gt;
&lt;P&gt;52,258&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not sure how I get this info-&lt;EM&gt;"&amp;nbsp;available network bandwidth between the servers."&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;SPAN&gt;After all, 4 fifths of the time SAS was waiting for data.-&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp; That's no good right? &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&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>Thu, 19 Sep 2019 12:28:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590000#M18047</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-09-19T12:28:11Z</dc:date>
    </item>
    <item>
      <title>Re: Requesting help with speed in reading DB2 tables?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590021#M18048</link>
      <description>&lt;P&gt;As soon as you move data over a network connection, that will be the bottleneck. The goal is to maximise the (logical) throughput. So handing off the processing of data-reducing actions (where, keep) to the DB is #1.&lt;/P&gt;
&lt;P&gt;Your network admins will be able to tell you what the maximum expectable bandwidth of your connection is, and when you compare that to your actual throughput, you'll see if further improvement is possible at all.&lt;/P&gt;
&lt;P&gt;Your DB admins should be able to provide you with table metadata (column types and other attributes), from which you can calculate observation sizes.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 13:35:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590021#M18048</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-09-19T13:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: Requesting help with speed in reading DB2 tables?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590022#M18049</link>
      <description>&lt;PRE&gt;
I don't know how you connect to DB2.
But try some options like :

libname potbnd DB2 datasrc=xxxx readbuff=10000 bulkload dbcommit=10000;

AND

proc copy .....


&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Sep 2019 13:38:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590022#M18049</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-09-19T13:38:13Z</dc:date>
    </item>
    <item>
      <title>Re: Requesting help with speed in reading DB2 tables?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590023#M18050</link>
      <description>&lt;PRE&gt;
I don't know how you connect to DB2.
But try some options like :

libname potbnd DB2 datasrc=xxxx readbuff=10000 bulkload dbcommit=10000;

AND

proc copy .....


&lt;/PRE&gt;</description>
      <pubDate>Thu, 19 Sep 2019 13:38:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590023#M18050</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-09-19T13:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: Requesting help with speed in reading DB2 tables?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590027#M18051</link>
      <description>&lt;P&gt;Thank you Xia. All I do is, login to SAS EG, on the left hand side, in the library list where I just right click on the name, the pop asks to assign or unassign. Once I click assign, it turns&lt;FONT color="#000000"&gt; "Yellow" stating it's assigned&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 13:43:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590027#M18051</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-09-19T13:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: Requesting help with speed in reading DB2 tables?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590168#M18053</link>
      <description>&lt;P&gt;Thank you Sir&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt;&amp;nbsp; I will take that to DB2 Admins and other concerned folks. In general, once the SAS/ACCESS is established to DB2, could the engine not give us the performance we need, even if it takes a little hit but not to the extent of what it shows in the above LOG. Am i being reasonable to have this expectation?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;here is the exact version info from the AIX server,&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;-------------------------------------------------------------------------------&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Host: r64&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Product: db2&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Version: 9.4&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Display Name: SAS/ACCESS Interface to DB2&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Display Version: 9.4_M3&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 19:42:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590168#M18053</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-09-19T19:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: Requesting help with speed in reading DB2 tables?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590182#M18054</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp; - To properly test DB2 connection performance you will need to learn to define your own database connections so you can experiment with different options. Just look at the Properties of your existing DB2 connections to figure out how to do this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest you also need to try SQL passthru where you can be sure everything is running the database. Just all part of the learning process for using external databases!&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 20:08:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590182#M18054</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-09-19T20:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: Requesting help with speed in reading DB2 tables?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590187#M18055</link>
      <description>&lt;P&gt;Sir &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;&amp;nbsp;Thought of the angel, I was gonna plug you. Just felt shy to get cheeky.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1.&lt;SPAN&gt;Properties of your existing DB2 connections&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can i do that? Is contacting DB2 folks the only way? or can it be done pro grammatically?If yes, may i get some examples?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2.&amp;nbsp; For SQL pass through, would CONNECT work once the SAS EG assign through libname is already established?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 20:13:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590187#M18055</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-09-19T20:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: Requesting help with speed in reading DB2 tables?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590191#M18056</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;- In EG select a DB2 connection in your Server List, right click and select Properties. Most of what you need in a LIBNAME statement should be shown after Options.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding SQL passthru CONNECT: You can refer to a LIBNAME here by doing: CONNECT USING &amp;lt;libref&amp;gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 20:27:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590191#M18056</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2019-09-19T20:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Requesting help with speed in reading DB2 tables?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590195#M18057</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp; You have given me some smile&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

24         proc copy in=potbnd out=work memtype=data;
25            select ar;
26         run;

NOTE: Copying POTBND.AR to WORK.AR (memtype=DATA).
NOTE: BUFSIZE is not cloned when copying across different engines. System Option for BUFSIZE was used.
NOTE: There were 55749594 observations read from the data set POTBND.AR.
NOTE: The data set WORK.AR has 55749594 observations and 76 variables.
NOTE: Compressing data set WORK.AR decreased size by 74.12 percent. 
      Compressed is 327922 pages; un-compressed would require 1267037 pages.
NOTE: PROCEDURE COPY used (Total process time):
      real time           26:03.24
      cpu time            8:37.57&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Much better than the datastep. Only thing is I wish I could apply a &lt;EM&gt;FILTER&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 20:34:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590195#M18057</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-09-19T20:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: Requesting help with speed in reading DB2 tables?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590198#M18058</link>
      <description>&lt;P&gt;Sir&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;&amp;nbsp; Thank you for the patience. This is what I see in properties&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;General DB2-POTBND&lt;BR /&gt;Type:Library&lt;BR /&gt;Server: SASApp&lt;BR /&gt;Engine: DB2&lt;BR /&gt;Location: /Shared Data/DB2-POTBND&lt;/P&gt;
&lt;P&gt;Options: schema='OTBND'&lt;BR /&gt;READ_ISOLATION_LEVL=UR&lt;BR /&gt;Datasrc=MODPOTBD&lt;/P&gt;
&lt;P&gt;Libref: POTBND&lt;BR /&gt;Read Only :No&lt;BR /&gt;Temporary: No&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2019 22:36:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590198#M18058</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-09-19T22:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: Requesting help with speed in reading DB2 tables?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590331#M18060</link>
      <description>&lt;P&gt;Here are two options . I recommend to use &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;&amp;nbsp; 's pass through .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1)&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;connect to db2(Datasrc=MODPOTBD &lt;SPAN&gt;schema='OTBND' readbuff=10000&lt;/SPAN&gt;) ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;create table want as&lt;/P&gt;
&lt;P&gt;select *&lt;/P&gt;
&lt;P&gt;&amp;nbsp;from connection to db2 (select * from &lt;SPAN&gt;xxxxxx&amp;nbsp; where .............&amp;nbsp;&lt;/SPAN&gt;);&lt;/P&gt;
&lt;P&gt;quit;&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;2)&lt;/P&gt;
&lt;P&gt;libname x db2&amp;nbsp;Datasrc=MODPOTBD &lt;SPAN&gt;schema='OTBND' readbuff=10000 ;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;proc sql;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;create table want as&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;select *&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;from x.xxxxxx&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; where ................;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;quit;&lt;/SPAN&gt;&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, 20 Sep 2019 11:29:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590331#M18060</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-09-20T11:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: Requesting help with speed in reading DB2 tables?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590336#M18061</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp; and&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;&amp;nbsp;, Let me try and update you how that goes. More importantly, Thank you for your patience and tolerance for all silly and basic stuff but that is something I am zero.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Sep 2019 11:36:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590336#M18061</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-09-20T11:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: Requesting help with speed in reading DB2 tables?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590573#M18064</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Whenever reading data from a database and moving the result set to SAS you want to concentrate on 2 things:&lt;/P&gt;
&lt;P&gt;1. Push processing to the database and reduce data volumes as much as possible on the DB side&lt;/P&gt;
&lt;P&gt;2. Move the data as efficiently over the network as possible&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For 1:&lt;/P&gt;
&lt;P&gt;If you're not using explicit pass-through SQL then use &lt;EM&gt;OPTIONS SASTRACE=',,,d' SASTRACELOC=SASLOG NOSTSUFFIX;&amp;nbsp;&lt;/EM&gt;before you read from the DB. This will tell you in the SAS log which part of your SAS statement the SAS/Access engine could push to the database.&lt;/P&gt;
&lt;P&gt;If you use dataset options and functions that SAS supports for pushing into the database then the SAS/Access engine will convert these instructions into DB2 SQL and send it to the database for execution.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I personally prefer to use SQL when interfacing with a database but SAS datastep code as below should work as well.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* option 1 */
data temp17_ar_1;
  set potbnd.ar(keep=src_stm_id where=(src_stm_id in (1,30,42,48,49)));
run;

/* option 2 */
proc sql;
  create table temp17_ar_1 as
    select src_stm_id
    from potbnd.ar
    where src_stm_id in (1,30,42,48,49)
  ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For 2:&lt;/P&gt;
&lt;P&gt;The bottleneck is very often the data transfer from the DB to SAS. There are many things out of your control here BUT the one thing you can change easily: Libname option READBUFF defines how many rows get transferred at once. If this options is not set explicitly then the default is 1. Increasing this value significantly leads often to much better performance.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Sep 2019 06:13:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590573#M18064</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-09-21T06:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: Requesting help with speed in reading DB2 tables?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590589#M18066</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;, Awesome points. Pity that I will have to wait till Monday to try that out alongside with help from admin. I request your patience if I may have any follow up question once I attempt interacting with the team/admin. Cheers!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Sep 2019 12:06:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590589#M18066</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-09-21T12:06:30Z</dc:date>
    </item>
    <item>
      <title>Re: Requesting help with speed in reading DB2 tables?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590675#M18067</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I like your passion.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here a few more things worth knowing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the library meta engine to assign a library that is defined in metadata as not pre-assigned (the white nodes in EG) using code as below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* 
  assign library defined in metadata that is not pre-assigned 
  - explicitly add option readbuff
  */
%let lref=potbnd;
libname &amp;amp;lref meta liburi="SASLibrary?@Libref='&amp;amp;lref'" metaout=data readbuff=100000;
libname &amp;amp;lref list;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The SAS/Access Engine can't push all SAS functions to DB2. The list of functions that can get pushed is &lt;A href="https://go.documentation.sas.com/?docsetId=acreldb&amp;amp;docsetTarget=n0johaiso73rs4n1qe1308qaaa50.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;here&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;If you use any other function in a where clause or join condition then SAS will first load the data into SAS and only execute the function within SAS. The code will still work but performance will degrade because more data gets transferred over the network.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Explicit pass-through SQL lets you write SQL in the database flavor. So here SAS will just send the code as-is to the database. This allows you full control what gets sent to the DB and you can also use DB functionality not available via implicit SQL or SAS datastep code.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* explicit pass-through SQL using a library definition to connect to a database */
proc sql;
  connect using &amp;amp;lref as mycon;
  select * from mycon as
  (
    select src_stm_id
    from OTBND.ar
    where src_stm_id in (1,30,42,48,49)
    with UR
  )
  ;
  disconnect from mycon;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;You've posted the connection info for you library....&lt;/P&gt;
&lt;PRE&gt;General DB2-POTBND
Type:Library
Server: SASApp
Engine: DB2
Location: /Shared Data/DB2-POTBND
Options: schema='OTBND'
READ_ISOLATION_LEVL=UR
Datasrc=MODPOTBD
Libref: POTBND
Read Only :No
Temporary: No&lt;/PRE&gt;
&lt;P&gt;...and it looks like the DB2 schema you need is already defined in your libary. I believe you therefore could omit the DB2 schema name in the DB2 SQL part. The advantage of a one level name: If the DB2 schema ever changes then the only place which requires amendment is the metadata libname definition.&lt;/P&gt;
&lt;PRE&gt;  .....
  (
    select src_stm_id
    from ar
    where src_stm_id in (1,30,42,48,49)
    with UR
  )
  .....&lt;/PRE&gt;
&lt;P&gt;What above also demonstrates: A SAS Libname connects to a single database schema and that's where your code executes. If you want to join tables from different schemas then you would need two different libnames - but in such a case SAS can only push schema specific filter conditions to the DB. It can't push conditions which require access to both schemas (as SAS uses two different connections/libnames).&lt;/P&gt;
&lt;P&gt;If you use explicit pass-through SQL then you can use a single libname and have the join in-database. You just need to use a two level name for your tables with the DB2 schema name as first part. This should work as long as the user connecting to the DB can access both schemas.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And last but not least:&lt;/P&gt;
&lt;P&gt;I'm not sure that what I've said about READBUFF applies to DB2. Still worth trying though. From the&amp;nbsp;&lt;A href="https://go.documentation.sas.com/?docsetId=acreldb&amp;amp;docsetTarget=p0u61lysy7qgzmn1bd66tz1om1yx.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;docu&lt;/A&gt;:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;DB2 under UNIX and PC Hosts&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;If you do not specify a value for this option, the default buffer size is automatically calculated based on the row length of your data. The SQLExtendedFetch API call is used&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have fun!&lt;/P&gt;</description>
      <pubDate>Sun, 22 Sep 2019 20:35:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590675#M18067</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-09-22T20:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: Requesting help with speed in reading DB2 tables?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590881#M18074</link>
      <description>&lt;P&gt;Good morning/Good evening Sir&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;&amp;nbsp;@down under. Thank you for all the details. I just got in and here is the test results&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;22         GOPTIONS ACCESSIBLE;
23         /*testing when yellow is unassigned on the left hand side in SAS EG*/
24         
25         %let lref=potbnd;
26         libname &amp;amp;lref meta liburi="SASLibrary?@Libref='&amp;amp;lref'" metaout=data readbuff=100000;
                                                                               ________
                                                                               22
ERROR: Libref POTBND is not assigned.
ERROR: Error in the LIBNAME statement.
ERROR 22-7: Invalid option name READBUFF.
27         libname &amp;amp;lref list;
ERROR: Libref POTBND is not assigned.
ERROR: Error in the LIBNAME statement.

23         /*testing when yellow is assigned on the left hand side in SAS EG*/
24         %let lref=potbnd;
25         libname &amp;amp;lref meta liburi="SASLibrary?@Libref='&amp;amp;lref'" metaout=data readbuff=100000;
                                                                               ________
                                                                               22
ERROR: Libref POTBND is not assigned.
ERROR: Error in the LIBNAME statement.
ERROR 22-7: Invalid option name READBUFF.
26         libname &amp;amp;lref list;
ERROR: Libref POTBND is not assigned.
ERROR: Error in the LIBNAME statement.

23         proc sql;
24           connect using potbnd as mycon;
ERROR: A Connection to the META DBMS is not currently supported, or is not installed at your site.
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
25           select * from mycon as
26           (
             _
             22
             76
ERROR 22-322: Expecting a name.  

ERROR 76-322: Syntax error, statement will be ignored.

27             select src_stm_id
28             from OTBND.ar
29             where src_stm_id in (1,30,42,48,49)
30             with UR
31           )
32           ;
33           disconnect from mycon;
NOTE: Statement not executed due to NOEXEC option.
34         quit;
NOTE: The SAS System stopped processing this step because of errors.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Any thoughts/points that I can take to the admin plz?&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 11:48:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590881#M18074</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-09-23T11:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: Requesting help with speed in reading DB2 tables?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590889#M18075</link>
      <description>&lt;P&gt;Then remove READBUFF= option, maybe it is not supported by DB2 .&lt;/P&gt;
&lt;P&gt;And did you try my 'connect to db2(datasrc=.....)'&amp;nbsp; ?&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2019 12:41:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Requesting-help-with-speed-in-reading-DB2-tables/m-p/590889#M18075</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-09-23T12:41:52Z</dc:date>
    </item>
  </channel>
</rss>

