DATA Step, Macro, Functions and more

Proc SQL Update

Reply
Frequent Contributor
Frequent Contributor
Posts: 131

Proc SQL Update

I have simple PROC SQL update, not sure why it dose not working.

 

PROC SQL;

UPDATE work.LOB2100_PF022_Summary

SET OHI_PLAN='Total Enrolled Health Plan';

QUIT;

 

 

Super User
Super User
Posts: 9,866

Re: Proc SQL Update

Not sure how we are supposed to tell from that.  Are there observations in the dataset?  Its telling you there was nothing to update.  The syntax works fine to update all rows in the dataset, 

data want;
  a="hello";
run;
proc sql;
  update want set a="Goodbye";
quit;

So either that dataset has no observations or you don't have permission to change it.

Frequent Contributor
Frequent Contributor
Posts: 131

Re: Proc SQL Update

New table, just needs update value.

 

Super User
Posts: 24,026

Re: Proc SQL Update


JHE wrote:

New table, just needs update value.

 


More words please. Not working doesn't tell us anything.

 

Super User
Super User
Posts: 9,866

Re: Proc SQL Update

Due to the fact you don't want to use communication I will guess that your post means that there is no observations, hence update has nothing to update.  If I was you I would start by learning Base SAS:

http://video.sas.com/#category/videos/how-to-tutorials

 

These will guide you on how to do all the various things in Base SAS - this is the language you are using so its good to have a thorough knowledge of it before adding additional sub components like SQL.  Several of the early videos will show multiple ways of getting data into SAS datasets to work on.

Frequent Contributor
Frequent Contributor
Posts: 131

Re: Proc SQL Update

this is only can update one record, what f we need a list of records to be insert into the new table.

Esteemed Advisor
Posts: 5,627

Re: Proc SQL Update

To insert a new record in your table use:

 

PROC SQL;
INSERT INTO work.LOB2100_PF022_Summary
SET OHI_PLAN='Total Enrolled Health Plan';
QUIT;
PG
Ask a Question
Discussion stats
  • 6 replies
  • 152 views
  • 0 likes
  • 4 in conversation