BookmarkSubscribeRSS Feed
JHE
Obsidian | Level 7 JHE
Obsidian | Level 7

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;

 

 

6 REPLIES 6
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

JHE
Obsidian | Level 7 JHE
Obsidian | Level 7

New table, just needs update value.

 

Reeza
Super User

@JHE wrote:

New table, just needs update value.

 


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

 

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

JHE
Obsidian | Level 7 JHE
Obsidian | Level 7

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

PGStats
Opal | Level 21

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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 6 replies
  • 773 views
  • 0 likes
  • 4 in conversation