<?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: Fastest way to read SAS table in C#? in Developers</title>
    <link>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/617782#M628</link>
    <description>&lt;P&gt;I have a lot of C# around SAS. Here is a method to handle the read. I would defer to Chris H.'s suggestions and drop/keep as many variables as you can. Contact me directly for a dll if needed. The below is in Framework: I have not converted to Core as of yet. OleDb is in flux on core and I haven't looked at latest info.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;public DataTable GetDataSet(string sasLibrary, string dataset)&lt;BR /&gt;{&lt;BR /&gt;OleDbConnection sas = null;&lt;BR /&gt;DataTable dt = new DataTable(dataset);&lt;BR /&gt;try&lt;BR /&gt;{&lt;BR /&gt;sas = new OleDbConnection(@"Provider=SAS.LocalProvider.1; Data Source=" + sasLibrary);&lt;BR /&gt;sas.Open();&lt;BR /&gt;OleDbCommand sasCommand = sas.CreateCommand();&lt;BR /&gt;sasCommand.CommandType = CommandType.TableDirect;&lt;BR /&gt;sasCommand.CommandText = dataset;&lt;BR /&gt;OleDbDataReader sasRead = sasCommand.ExecuteReader();&lt;BR /&gt;dt.Load(sasRead);&lt;BR /&gt;sas.Close();&lt;BR /&gt;}&lt;BR /&gt;catch (Exception ex)&lt;BR /&gt;{&lt;BR /&gt;sas.Close();&lt;BR /&gt;string errMessage = "Unable to get the SAS dataset. Library: " + sasLibrary + ", DataSet: " + dataset + ", " +&lt;BR /&gt;ex.TargetSite.Name;&lt;BR /&gt;HandleError(MethodBase.GetCurrentMethod().Name, ex);&lt;BR /&gt;}&lt;BR /&gt;finally&lt;BR /&gt;{&lt;BR /&gt;sas.Close();&lt;BR /&gt;}&lt;BR /&gt;return dt;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;public DataTable GetSasDataSetMetadata(string sasLibrary, string dataset)&lt;BR /&gt;{&lt;BR /&gt;OleDbConnection sas = null;&lt;BR /&gt;try&lt;BR /&gt;{&lt;BR /&gt;sas = new OleDbConnection(@"Provider=sas.LocalProvider; Data Source=" + sasLibrary);&lt;BR /&gt;sas.Open();&lt;BR /&gt;OleDbCommand sasCommand = sas.CreateCommand();&lt;BR /&gt;sasCommand.CommandType = CommandType.TableDirect;&lt;BR /&gt;sasCommand.CommandText = dataset;&lt;BR /&gt;DataTable dt = sas.GetSchema("Columns");&lt;BR /&gt;DataView dv = dt.DefaultView;&lt;BR /&gt;dv.RowFilter = "TABLE_NAME = '" + dataset.ToUpper() + "'";&lt;BR /&gt;sas.Close();&lt;BR /&gt;return dv.ToTable();&lt;BR /&gt;}&lt;BR /&gt;catch (Exception ex)&lt;BR /&gt;{&lt;BR /&gt;HandleError(MethodBase.GetCurrentMethod().Name, ex);&lt;BR /&gt;return null;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
    <pubDate>Thu, 16 Jan 2020 15:12:59 GMT</pubDate>
    <dc:creator>AlanC</dc:creator>
    <dc:date>2020-01-16T15:12:59Z</dc:date>
    <item>
      <title>Fastest way to read SAS table in C#?</title>
      <link>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/617724#M622</link>
      <description>&lt;P&gt;I am currently reading SAS tables using DbCommand.ExecuteReader with&amp;nbsp;CommandType.TableDirect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is this the fastest way to read data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kevin&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2020 11:31:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/617724#M622</guid>
      <dc:creator>keV</dc:creator>
      <dc:date>2020-01-16T11:31:12Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest way to read SAS table in C#?</title>
      <link>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/617734#M623</link>
      <description>&lt;P&gt;I'll suspect XMLs to be faster if you have them. But with sas7bdat, maybe you can have a look at these papers:&amp;nbsp;&lt;A href="https://analytics.ncsu.edu/sesug/2007/AD11.pdf" target="_blank" rel="noopener"&gt;SESUG paper&lt;/A&gt;&amp;nbsp;&lt;A href="http://support.sas.com/kb/25/276.html" target="_blank" rel="noopener"&gt;SAS Support&lt;/A&gt; and &lt;A href="https://phejndorf.wordpress.com/2007/05/02/how-to-read-a-sas-dataset-with-c/" target="_blank" rel="noopener"&gt;Blog&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 12:24:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/617734#M623</guid>
      <dc:creator>Oligolas</dc:creator>
      <dc:date>2020-01-21T12:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest way to read SAS table in C#?</title>
      <link>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/617736#M624</link>
      <description>&lt;P&gt;Maybe &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4"&gt;@ChrisHemedinger&lt;/a&gt; could give you a hand.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2020 12:35:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/617736#M624</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-01-16T12:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest way to read SAS table in C#?</title>
      <link>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/617744#M625</link>
      <description>&lt;P&gt;It depends on the dimensions of the table and whether you're reading it as a bulk set or paging in across groups of observations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a simple example &lt;A href="https://github.com/sassoftware/sas-inttech-samples" target="_self"&gt;in the SASHarness application in GitHub&lt;/A&gt;.&amp;nbsp; If you don't need all the data at once, I suggest applying data set options like FIRSTOBS, OBS=, KEEP and/or DROP, and WHERE= to limit the data that SAS will return.&amp;nbsp; This is assuming that you are connecting to a SAS session to read this data.&amp;nbsp; The SAS data providers will read the entire row, so wider data is naturally slower to read.&amp;nbsp; You can limit this if you don't need all columns by applying KEEP or DROP when you open the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If reading sas7bdat files directly using the SAS Local OLE DB provider (no SAS session), then options are more limited, I think.&amp;nbsp;&lt;A href="https://blogs.sas.com/content/sasdummy/2012/04/12/build-your-own-sas-data-set-viewer-using-powershell/" target="_self"&gt; I have a Windows PowerShell example that you may be able to adapt.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2020 13:00:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/617744#M625</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2020-01-16T13:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest way to read SAS table in C#?</title>
      <link>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/617746#M626</link>
      <description>&lt;P&gt;If you don't have SAS software licensed, you may try to integrate the following&amp;nbsp;&lt;SPAN&gt;&lt;A title="ReadStat: Read (and write) data sets from SAS, Stata, and SPSS" href="https://github.com/WizardMac/ReadStat" target="_blank" rel="noopener"&gt;command-line tool and MIT-licensed C library&lt;/A&gt; into your C# code&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hope this helps,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Ahmed&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2020 13:09:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/617746#M626</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2020-01-16T13:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest way to read SAS table in C#?</title>
      <link>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/617774#M627</link>
      <description>&lt;P&gt;Thanks to everyone for your speedy replies. There doesn't seem any obvious alternative to what I'm already doing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have been using the Local provider with the ADO .Net recipe referenced in one of the replies for several years now, but one of our clients has complained of slow reading with large datasets. However, the reading from the SAS file is just one part of the overall process so I will go and do some further investigation of the whole process and see where the bottlenecks are.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks again for everyone's interest..&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2020 14:54:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/617774#M627</guid>
      <dc:creator>keV</dc:creator>
      <dc:date>2020-01-16T14:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest way to read SAS table in C#?</title>
      <link>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/617782#M628</link>
      <description>&lt;P&gt;I have a lot of C# around SAS. Here is a method to handle the read. I would defer to Chris H.'s suggestions and drop/keep as many variables as you can. Contact me directly for a dll if needed. The below is in Framework: I have not converted to Core as of yet. OleDb is in flux on core and I haven't looked at latest info.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;public DataTable GetDataSet(string sasLibrary, string dataset)&lt;BR /&gt;{&lt;BR /&gt;OleDbConnection sas = null;&lt;BR /&gt;DataTable dt = new DataTable(dataset);&lt;BR /&gt;try&lt;BR /&gt;{&lt;BR /&gt;sas = new OleDbConnection(@"Provider=SAS.LocalProvider.1; Data Source=" + sasLibrary);&lt;BR /&gt;sas.Open();&lt;BR /&gt;OleDbCommand sasCommand = sas.CreateCommand();&lt;BR /&gt;sasCommand.CommandType = CommandType.TableDirect;&lt;BR /&gt;sasCommand.CommandText = dataset;&lt;BR /&gt;OleDbDataReader sasRead = sasCommand.ExecuteReader();&lt;BR /&gt;dt.Load(sasRead);&lt;BR /&gt;sas.Close();&lt;BR /&gt;}&lt;BR /&gt;catch (Exception ex)&lt;BR /&gt;{&lt;BR /&gt;sas.Close();&lt;BR /&gt;string errMessage = "Unable to get the SAS dataset. Library: " + sasLibrary + ", DataSet: " + dataset + ", " +&lt;BR /&gt;ex.TargetSite.Name;&lt;BR /&gt;HandleError(MethodBase.GetCurrentMethod().Name, ex);&lt;BR /&gt;}&lt;BR /&gt;finally&lt;BR /&gt;{&lt;BR /&gt;sas.Close();&lt;BR /&gt;}&lt;BR /&gt;return dt;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;public DataTable GetSasDataSetMetadata(string sasLibrary, string dataset)&lt;BR /&gt;{&lt;BR /&gt;OleDbConnection sas = null;&lt;BR /&gt;try&lt;BR /&gt;{&lt;BR /&gt;sas = new OleDbConnection(@"Provider=sas.LocalProvider; Data Source=" + sasLibrary);&lt;BR /&gt;sas.Open();&lt;BR /&gt;OleDbCommand sasCommand = sas.CreateCommand();&lt;BR /&gt;sasCommand.CommandType = CommandType.TableDirect;&lt;BR /&gt;sasCommand.CommandText = dataset;&lt;BR /&gt;DataTable dt = sas.GetSchema("Columns");&lt;BR /&gt;DataView dv = dt.DefaultView;&lt;BR /&gt;dv.RowFilter = "TABLE_NAME = '" + dataset.ToUpper() + "'";&lt;BR /&gt;sas.Close();&lt;BR /&gt;return dv.ToTable();&lt;BR /&gt;}&lt;BR /&gt;catch (Exception ex)&lt;BR /&gt;{&lt;BR /&gt;HandleError(MethodBase.GetCurrentMethod().Name, ex);&lt;BR /&gt;return null;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2020 15:12:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/617782#M628</guid>
      <dc:creator>AlanC</dc:creator>
      <dc:date>2020-01-16T15:12:59Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest way to read SAS table in C#?</title>
      <link>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/618831#M631</link>
      <description>&lt;P&gt;Thanks - this is exactly what I'm already doing, but exposing the DataReader rather than pre-reading into a table.&lt;/P&gt;
&lt;P&gt;I think this is safer and less memory intensive for large tables.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 11:48:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/618831#M631</guid>
      <dc:creator>keV</dc:creator>
      <dc:date>2020-01-21T11:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest way to read SAS table in C#?</title>
      <link>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/618843#M632</link>
      <description>&lt;P&gt;What are you using for .NET? Is it Framework or Core and what version,please.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 12:54:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/618843#M632</guid>
      <dc:creator>AlanC</dc:creator>
      <dc:date>2020-01-21T12:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest way to read SAS table in C#?</title>
      <link>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/618847#M633</link>
      <description>&lt;P&gt;.Net Framework 4.6.1&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 13:08:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/618847#M633</guid>
      <dc:creator>keV</dc:creator>
      <dc:date>2020-01-21T13:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest way to read SAS table in C#?</title>
      <link>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/618852#M634</link>
      <description>&lt;P&gt;If possible, switch to .NET Core 3.1.1. OleDb is supported on .NET Core 3+. Why? It is a lot faster than Framework and you will probably get an intrinsic boost. Plus, Core is the way to go for all future stuff as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Take a look at this SO article:&lt;A href="https://stackoverflow.com/questions/40718537/how-to-convert-idatareader-into-stream-in-c-sharp" target="_blank"&gt;https://stackoverflow.com/questions/40718537/how-to-convert-idatareader-into-stream-in-c-sharp&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Specifically,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class="lang-cs prettyprint prettyprinted"&gt;&lt;CODE&gt;&lt;SPAN class="kwd"&gt;public&lt;/SPAN&gt; &lt;SPAN class="typ"&gt;IEnumerable&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="typ"&gt;Order&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="typ"&gt;GetOrders&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;()&lt;/SPAN&gt;
&lt;SPAN class="pun"&gt;{&lt;/SPAN&gt;
   &lt;SPAN class="typ"&gt;IDbCommand&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; cmd &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;...&lt;/SPAN&gt;  &lt;SPAN class="pun"&gt;&amp;lt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;build your command here&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;&amp;gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;...&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;
   using&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="kwd"&gt;var&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; rdr &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; cmd&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="typ"&gt;ExecuteDataReader&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;())&lt;/SPAN&gt;
   &lt;SPAN class="pun"&gt;{&lt;/SPAN&gt;
      &lt;SPAN class="kwd"&gt;while&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;rdr&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="typ"&gt;Read&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;())&lt;/SPAN&gt;
      &lt;SPAN class="pun"&gt;{&lt;/SPAN&gt;
          &lt;SPAN class="typ"&gt;Order&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; order &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt; &lt;SPAN class="kwd"&gt;new&lt;/SPAN&gt; &lt;SPAN class="typ"&gt;Order&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;{&lt;/SPAN&gt;&lt;SPAN class="typ"&gt;Id&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;rdr&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="typ"&gt;GetDecimal&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="lit"&gt;1&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;),&lt;/SPAN&gt; &lt;SPAN class="typ"&gt;Name&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;rdr&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="typ"&gt;GetString&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;(&lt;/SPAN&gt;&lt;SPAN class="lit"&gt;2&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;)};&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;
          yield &lt;/SPAN&gt;&lt;SPAN class="kwd"&gt;return&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; order&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;;&lt;/SPAN&gt;
      &lt;SPAN class="pun"&gt;}&lt;/SPAN&gt;
   &lt;SPAN class="pun"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="pun"&gt;}&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I may be able to test something but I am pretty busy right now. I think switching to Core is needed unless there is something compelling keeping you away. I have been using Core for a long time and honestly, Core 3.1 is fantastic.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 13:25:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/618852#M634</guid>
      <dc:creator>AlanC</dc:creator>
      <dc:date>2020-01-21T13:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest way to read SAS table in C#?</title>
      <link>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/618859#M635</link>
      <description>&lt;P&gt;Thanks for the tip Alan. SAS data is just one part of a data reading component, which we have already partially migrated to .Net Core. OleDb wasn't available at the time in .Net Core. We'll definitely look at that soon.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why do you think it is faster when it is still using SAS's OleDB component?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 13:36:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/618859#M635</guid>
      <dc:creator>keV</dc:creator>
      <dc:date>2020-01-21T13:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest way to read SAS table in C#?</title>
      <link>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/618861#M636</link>
      <description>&lt;P&gt;OleDb support in Core was a hot topic for a number of shops migrating from Framework to Core due to things like Access DB. It was added in in May 2019 and was put into Core 3.0 in Sept as a release.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I cannot say for sure that it will be faster. It requires testing. Heck, it may not work but give it a try in a small, isolated test project.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are welcome to reach out to me directly as well. If I get a chance, I will try and test on my own.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 13:43:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/618861#M636</guid>
      <dc:creator>AlanC</dc:creator>
      <dc:date>2020-01-21T13:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest way to read SAS table in C#?</title>
      <link>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/618874#M637</link>
      <description>&lt;P&gt;Yep, we've been waiting for the OleDb support. Hopefully we'll find some time to address it shortly.&amp;nbsp; Thanks again for all your help. I'll keep you posted.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jan 2020 14:31:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/618874#M637</guid>
      <dc:creator>keV</dc:creator>
      <dc:date>2020-01-21T14:31:46Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest way to read SAS table in C#?</title>
      <link>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/619040#M638</link>
      <description>&lt;P&gt;This works in Core 3.1.1 with nuget System.Data.OleDb and SAS Provider for OleDb 9.48. Solution attached:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;        static void Main(string[] args)
        {
            Console.WriteLine("Starting test...");
            var dt = ReadSasDataset(@"z:\scratch", "shoes");
        }

        private static DataTable ReadSasDataset(string sasLibrary, string dataset)
        {
            OleDbConnection sas = null;
            DataTable dt = new DataTable(dataset);
            try
            {
                sas = new OleDbConnection(@"Provider=SAS.LocalProvider.1; Data Source=" + sasLibrary);
                sas.Open();
                OleDbCommand sasCommand = sas.CreateCommand();
                sasCommand.CommandType = CommandType.TableDirect;
                sasCommand.CommandText = dataset;
                OleDbDataReader sasRead = sasCommand.ExecuteReader();
                dt.Load(sasRead);
                sas.Close();
            }
            catch (Exception ex)
            {
                sas.Close();
                string errMessage = "Unable to get the SAS dataset. Library: " + sasLibrary + ", DataSet: " + dataset + ", " +
                    ex.TargetSite.Name;
            }
            finally
            {
                sas.Close();
            }
            return dt;
        }&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 05:49:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/619040#M638</guid>
      <dc:creator>AlanC</dc:creator>
      <dc:date>2020-01-22T05:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest way to read SAS table in C#?</title>
      <link>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/621126#M643</link>
      <description>&lt;P&gt;Well, I've tried it (no code change required) with Core 3.1.1. and the reading of a large file is consistently a few % slower.&lt;/P&gt;
&lt;P&gt;Oh well, worth a try.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 13:19:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/621126#M643</guid>
      <dc:creator>keV</dc:creator>
      <dc:date>2020-01-30T13:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest way to read SAS table in C#?</title>
      <link>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/621167#M644</link>
      <description>&lt;P&gt;You are welcome to contact me directly and we can figure out approaches. alan.churchill@savian.net&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 15:04:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/621167#M644</guid>
      <dc:creator>AlanC</dc:creator>
      <dc:date>2020-01-30T15:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest way to read SAS table in C#?</title>
      <link>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/631576#M673</link>
      <description>&lt;P&gt;Hi keV&lt;BR /&gt;Do you mind sharing the code that allows you to read from SAS tables ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 14:30:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/631576#M673</guid>
      <dc:creator>yoyo02</dc:creator>
      <dc:date>2020-03-12T14:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest way to read SAS table in C#?</title>
      <link>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/631639#M674</link>
      <description>&lt;P&gt;I posted a zip file on page 1 of this thread.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 17:09:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/631639#M674</guid>
      <dc:creator>AlanC</dc:creator>
      <dc:date>2020-03-12T17:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: Fastest way to read SAS table in C#?</title>
      <link>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/631640#M675</link>
      <description>&lt;P&gt;AlanC just beat me to it. The code is also clearly shown in two of the other posts in the thread.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2020 17:12:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Fastest-way-to-read-SAS-table-in-C/m-p/631640#M675</guid>
      <dc:creator>keV</dc:creator>
      <dc:date>2020-03-12T17:12:00Z</dc:date>
    </item>
  </channel>
</rss>

