Your SAS programs, embedded in web apps and elsewhere

Reading and updating a SAS dataset

Reply
N/A
Posts: 0

Reading and updating a SAS dataset

I thought the hard part was reading a SAS Dataset and its metadata. It turned out to be easy.

The hard part actually comes when its time to update a SAS dataset after editing its content, variable attributes (like variable name, format, informat, column label, etc). What makes it seem impossible using the SAS Integrated Object Model (IOM) is the fact that not every SAS dataset has a suitable column that can be used as a primary key. Setting up an InsertCommand/DeleteCommand/UpdateCommand for an OleDBDataAdapter object requires a primary key, otherwise you get this error message:

"Dynamic SQL generation is not supported against a SelectCommand that does not return any base table information."

Now if someone out there can point me to a solution without resorting to writing and submitting a DATASTEP-based code, that would be great. Of course, with the SAS dataset content read successfully into a DataGridView control (with SAS DATE formats converted into a DateTime format), writing a DATASTEP-based code to save the grid's content into a SAS dataset should not be that difficult.

Or is it? :-)

Thanks, Audi
N/A
Posts: 0

Re: Reading and updating a SAS dataset

Audi, did you ever find a solution to this.
Ask a Question
Discussion stats
  • 1 reply
  • 171 views
  • 0 likes
  • 1 in conversation