BookmarkSubscribeRSS Feed
LAtwood
Calcite | Level 5


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.

1 REPLY 1
LinusH
Tourmaline | Level 20

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

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

Data never sleeps

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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