DATA Step, Macro, Functions and more

Update / modify table by odbc

Frequent Contributor
Posts: 83

Update / modify table by odbc

I am trying to connect via odbc to update a table using a SAS table I created in SAS Enterprise Guide.

I have tried code similar to this, but I am not getting the results I desire.

libname odbclib odbc noprompt= "Driver,Server, DB, ID, PWD, etc".

data odbclib.servertable;

set work.sasegtable;

ytd_earnings = qtr_amount

sen_yrs = Senioriry Years

where clock_num = Clock Number

and pay_yr = Pay Year;

"Servertable" is the table on the server I would like to update with the SAS EG table "sasegtable"

I have no problems with my libname statement, just not sure what syntax to use to update a table this way or using the odbc statement.

Any help with this would be appreciated.

Super User
Posts: 5,888

Re: Update / modify table by odbc

If you wish to use the data step, you need to use the MODIFY statement, see on-line doc and samples on

You could also use SQL (which your syntax looks like), but then you need to do a correlated sub query. Again, search

Data never sleeps
Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation