Desktop productivity for business analysts and programmers

Updating/Creating a SAS Dataset with .NET

Reply
Frequent Contributor
Posts: 121

Updating/Creating a SAS Dataset with .NET

hi,

I'm developing a .NET program which creates an ADO.NET DataTable from an existing SAS Library via the SAS OleDB dataprovider and now i want to write the changes in the DataTable back to SAS.

After reading the documentation for SAS IT, SAS IOM, SAS OleDB Provider i come to the conclusion that there is no simple way to achieve this. The most helpful documentation i found was this:

http://support.sas.com/documentation/tools/oledb/rr_createdelete.htm

There are three methods described:
1) using SQL Statements will be difficult and i guess that the performance will be terrible if i submit a CREATE TABLE followed by a million INSERT INTO SQL Statements.
2) using the ITableDefinition interface: is this even possible in .NET? Can i add rows to the table?
3) using ADOX: seems to be the only reasonable method to create and fill a SAS dataset. Has anybody tried that method yet?

Am i missing something here? Is there really no simple solution provided by SAS to update or create a new SAS dataset when you are using SAS/IT with the SAS data providers in the .NET Framework?

I hope that Chris or somebody else can help me!
Community Manager
Posts: 2,882

Re: Updating/Creating a SAS Dataset with .NET

Andreas,

Here is an example EG custom task that does this:

http://support.sas.com/documentation/onlinedoc/guide/customtasks/samples/FSEdit42.zip

I realize your application is not running within EG, but you could use a similar approach. That is, use the SAS IOM OLE DB provider to read the data, and use the SAS Workspace LanguageService to update the data table using PROC SQL UPDATE.

Chris
Ask a Question
Discussion stats
  • 1 reply
  • 318 views
  • 0 likes
  • 2 in conversation