<?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: Writing local SAS tables from 64-bit C# process without explicit SAS references in Administration and Deployment</title>
    <link>https://communities.sas.com/t5/Administration-and-Deployment/Writing-local-SAS-tables-from-64-bit-C-process-without-explicit/m-p/168640#M2144</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is no easy way to write to SAS datasets.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;You might want to try the SAS ODBC drivers, but ODBC brings a lot of pain, too.&lt;/LI&gt;&lt;LI&gt;Then there is an undocumented and strange API for the COM interface SAS.IDataSet. I would not recommend anyone to use that.&lt;/LI&gt;&lt;LI&gt;Another option would be to export your data to a CSV or XML file, transport it to your SAS server and import it with SAS code.&lt;/LI&gt;&lt;LI&gt;So OleDB is still the best way to write a SAS dataset. &lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess when you talk about "single row SQL insert queries" your programm inserts one row and waits for the OleDB provider to finish until the next row is sent. So you might get a performance boost if you insert multiple rows with a single SQL statement. You can insert multiple rows with a &lt;STRONG&gt;SET&lt;/STRONG&gt; or &lt;STRONG&gt;VALUES&lt;/STRONG&gt; clause (see &lt;A href="http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002294531.htm"&gt;http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002294531.htm&lt;/A&gt; for example).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you find a better way for writing a SAS dataset with OleDB please post your solution here. I'm looking for it since years. It's about time that someone writes an awesome ADO.NET Entity Framework provider for SAS tables :smileylaugh:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 06 Apr 2014 22:08:16 GMT</pubDate>
    <dc:creator>AndreasMenrath</dc:creator>
    <dc:date>2014-04-06T22:08:16Z</dc:date>
    <item>
      <title>Writing local SAS tables from 64-bit C# process without explicit SAS references</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Writing-local-SAS-tables-from-64-bit-C-process-without-explicit/m-p/168639#M2143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hopefully this is in the right place as it's my first question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We are developing an application where part of the data handling requirements is to read and write local SAS files (Server comes later).&lt;/P&gt;&lt;P&gt;We prefer not to have any specific SAS assembly references in our code.&lt;/P&gt;&lt;P&gt;Following the cookbook recipe, we can write SAS files using the IOM Provider in _Local_ mode.&lt;/P&gt;&lt;P&gt;However, the examples still use ADODB, which is only possible in 32-bit, as no 64-bit version will ever exist of ADODB.dll&lt;/P&gt;&lt;P&gt;I have tried rewriting in ADO .NET using a DataAdapter but this is doomed to failure because the IOM provider does not support parameterised queries.&lt;/P&gt;&lt;P&gt;My only other option appears to be to repeatedly construct and execute single row SQL insert queries.&lt;/P&gt;&lt;P&gt;This works, but is, not surprisingly, very slow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone suggest a better method to achieve this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, Kevin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Apr 2014 08:02:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Writing-local-SAS-tables-from-64-bit-C-process-without-explicit/m-p/168639#M2143</guid>
      <dc:creator>keV</dc:creator>
      <dc:date>2014-04-04T08:02:51Z</dc:date>
    </item>
    <item>
      <title>Re: Writing local SAS tables from 64-bit C# process without explicit SAS references</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Writing-local-SAS-tables-from-64-bit-C-process-without-explicit/m-p/168640#M2144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is no easy way to write to SAS datasets.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;You might want to try the SAS ODBC drivers, but ODBC brings a lot of pain, too.&lt;/LI&gt;&lt;LI&gt;Then there is an undocumented and strange API for the COM interface SAS.IDataSet. I would not recommend anyone to use that.&lt;/LI&gt;&lt;LI&gt;Another option would be to export your data to a CSV or XML file, transport it to your SAS server and import it with SAS code.&lt;/LI&gt;&lt;LI&gt;So OleDB is still the best way to write a SAS dataset. &lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess when you talk about "single row SQL insert queries" your programm inserts one row and waits for the OleDB provider to finish until the next row is sent. So you might get a performance boost if you insert multiple rows with a single SQL statement. You can insert multiple rows with a &lt;STRONG&gt;SET&lt;/STRONG&gt; or &lt;STRONG&gt;VALUES&lt;/STRONG&gt; clause (see &lt;A href="http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002294531.htm"&gt;http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002294531.htm&lt;/A&gt; for example).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you find a better way for writing a SAS dataset with OleDB please post your solution here. I'm looking for it since years. It's about time that someone writes an awesome ADO.NET Entity Framework provider for SAS tables :smileylaugh:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 06 Apr 2014 22:08:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Writing-local-SAS-tables-from-64-bit-C-process-without-explicit/m-p/168640#M2144</guid>
      <dc:creator>AndreasMenrath</dc:creator>
      <dc:date>2014-04-06T22:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: Writing local SAS tables from 64-bit C# process without explicit SAS references</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Writing-local-SAS-tables-from-64-bit-C-process-without-explicit/m-p/168641#M2145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Andreas, many thanks.&lt;/P&gt;&lt;P&gt;Using multiple VALUES sets in the insert query does give a very significant performance boost - it reduces my test write time from 8s to 2s, writing 5 rows instead of 1 row in each insert.&lt;/P&gt;&lt;P&gt;The next question is, does anyone know the character size limit of the query text? I could then dynamically adjust the number of rows I write for each insert to be the maximum within this limit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Apr 2014 07:37:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Writing-local-SAS-tables-from-64-bit-C-process-without-explicit/m-p/168641#M2145</guid>
      <dc:creator>keV</dc:creator>
      <dc:date>2014-04-09T07:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: Writing local SAS tables from 64-bit C# process without explicit SAS references</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Writing-local-SAS-tables-from-64-bit-C-process-without-explicit/m-p/168642#M2146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;
&lt;P&gt;it reduces my test write time from 8s to 2s, writing 5 rows instead of 1 row in each insert.&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;That is still very slow. I guess that most of that time is used to open the dataset and initialize the driver. Can you try 1000 rows and measure the performance?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;
&lt;P&gt;The next question is, does anyone know the character size limit of the query text?&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;There is no documented limit. Maybe 32K (32768) characters. &lt;/P&gt;&lt;P&gt;As a best practice you should try different lengths. If there is a limit it may be different in each SAS version and x86 and x64.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Apr 2014 19:03:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Writing-local-SAS-tables-from-64-bit-C-process-without-explicit/m-p/168642#M2146</guid>
      <dc:creator>AndreasMenrath</dc:creator>
      <dc:date>2014-04-21T19:03:20Z</dc:date>
    </item>
    <item>
      <title>Re: Writing local SAS tables from 64-bit C# process without explicit SAS references</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Writing-local-SAS-tables-from-64-bit-C-process-without-explicit/m-p/168643#M2147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/oledbpr/63701/HTML/default/viewer.htm#p04urh2v44qdsgn19blwaw423euz.htm" title="http://support.sas.com/documentation/cdl/en/oledbpr/63701/HTML/default/viewer.htm#p04urh2v44qdsgn19blwaw423euz.htm"&gt;SAS(R) 9.3 Providers for OLE DB: Cookbook&lt;/A&gt;&amp;nbsp;&amp;nbsp; (Tips for 64-bit Programming)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Apr 2014 07:21:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Writing-local-SAS-tables-from-64-bit-C-process-without-explicit/m-p/168643#M2147</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-04-22T07:21:08Z</dc:date>
    </item>
    <item>
      <title>Re: Writing local SAS tables from 64-bit C# process without explicit SAS references</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Writing-local-SAS-tables-from-64-bit-C-process-without-explicit/m-p/168644#M2148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I didn't say how many rows I wrote in total, only how many I did in each operation! That was for a 1000 rows.&lt;/P&gt;&lt;P&gt;I've now adjusted my code to dynamically adjust the number of rows per operation, based upon the query length as it is built up.&lt;/P&gt;&lt;P&gt;Thanks for your input.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 09:15:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Writing-local-SAS-tables-from-64-bit-C-process-without-explicit/m-p/168644#M2148</guid>
      <dc:creator>keV</dc:creator>
      <dc:date>2014-04-28T09:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: Writing local SAS tables from 64-bit C# process without explicit SAS references</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Writing-local-SAS-tables-from-64-bit-C-process-without-explicit/m-p/168645#M2149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry Jaap. I don't see how that link helps answer my question.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 09:16:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Writing-local-SAS-tables-from-64-bit-C-process-without-explicit/m-p/168645#M2149</guid>
      <dc:creator>keV</dc:creator>
      <dc:date>2014-04-28T09:16:13Z</dc:date>
    </item>
    <item>
      <title>Re: Writing local SAS tables from 64-bit C# process without explicit SAS references</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/Writing-local-SAS-tables-from-64-bit-C-process-without-explicit/m-p/168646#M2150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry keV as you mentioned several issues&lt;/P&gt;&lt;P&gt;I was focussed on you 32-bit 64-bit issue. That is more common and the approach is to have all components on the same bitness. That is what my link was for.&lt;/P&gt;&lt;P&gt;Rereading your question, I have more questions as answers. You are building something in .Net as Eguide AMO are also .Net applications you are building some functionality of that in the same way. The behavior on IOM and COM will be similar. I know those tools better. Builing in ADO .Net never needed to do. I know around Andreas it is/was done.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "com" option is used for a local SAS dataset. It will start a SAS process for that, you should be able to see that running.&lt;/P&gt;&lt;P&gt;In your .Net coding you will see CreateWorkspaceByServer&amp;nbsp;&amp;nbsp; RemoveWorkspace that must be the one doing that. &lt;/P&gt;&lt;P&gt;As starting a sas-process will take a lot of time (many seconds) starting and stopping this will cost a lot of time.&lt;/P&gt;&lt;P&gt;When the sas-process&amp;nbsp; or the datasets behind is badly tuned you will have a bad performance.&lt;/P&gt;&lt;P&gt;As far I can see you can submit SAS language code using Ado.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;(&lt;A href="http://support.sas.com/documentation/cdl/en/itechwcdg/62763/HTML/default/viewer.htm#p0k5pi1ln9y6g4n1lfbbygjrriwz.htm" title="http://support.sas.com/documentation/cdl/en/itechwcdg/62763/HTML/default/viewer.htm#p0k5pi1ln9y6g4n1lfbbygjrriwz.htm"&gt;SAS(R) 9.3 Integration Technologies: Windows Client Developer's Guide&lt;/A&gt; Using Local SAS with ADO - sample )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you go for an IOM server. Also a SASs process need to run. I am recognizing the pooling and normal workspace servers as started by a object spawner (service).&lt;/P&gt;&lt;P&gt;The normal workspace server is normally run (at OS level Unix) by a personal key and needing that password/login being propagated. The start time of that process needed to add for a response. The pooledworkspace server will run by a shared account (like the STP) and by that sharing you will not see the start process overhead.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 10:18:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/Writing-local-SAS-tables-from-64-bit-C-process-without-explicit/m-p/168646#M2150</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-04-28T10:18:36Z</dc:date>
    </item>
  </channel>
</rss>

