BookmarkSubscribeRSS Feed
AndreasMenrath
Pyrite | Level 9
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!
1 REPLY 1
ChrisHemedinger
Community Manager
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
SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1371 views
  • 0 likes
  • 2 in conversation