DATA Step, Macro, Functions and more

Updating a column based on a join from a column on another table

Reply
Contributor
Posts: 33

Updating a column based on a join from a column on another table

Hi,
I don't mind if the solution is in PROC SQL or datastep but I am
struggling with how to do this:-

a=tablea
b=tableb

update tablea
set a.col1 = b.col1
where a.col2 = b.col2

Regards
Lee Message was edited by: Lee2010
Super Contributor
Super Contributor
Posts: 3,174

Re: Updating a column based on a join from a column on another table

Posted in reply to LeeJenson
One option: a DATA step using properly sorted input and a MERGE with a BY statement.

Scott Barry
SBBWorks, Inc.

Recommended Google advanced search argument, this topic/post:

merge processing site:sas.com
Contributor
Posts: 33

Re: Updating a column based on a join from a column on another table

Thanks Scott

the merge worked fine.

Lee
Ask a Question
Discussion stats
  • 2 replies
  • 110 views
  • 0 likes
  • 2 in conversation