BookmarkSubscribeRSS Feed
archana
Fluorite | Level 6

Hi,

my criteria is to update the existing record if it exists in the cumulative dataset else if it is new record then it needs to be added to the cumulative dataset. The cumulative data contains history data .

I tried the below but it didnt work. Any other suggestions-

 

data adhoc.dly_cumulative;

update adhoc.dly_cumulative  adhoc.dly_&day0

by column;

run;

6 REPLIES 6
Reeza
Super User

How didn't it work?

Update is designed exactly that function, update record if it exists or add it in otherwise.

archana
Fluorite | Level 6

 

ERROR 411-185: The UPDATE statement requires two data sets, too many data sets have been specified.

This is the error i am getting when trying to execute the above.

Reeza
Super User

Post your full log then. My *guess* is that your macro variable is resolving with spaces so the update statement see's 3 datasets?

Howles
Quartz | Level 8

UPDATE, or MODIFY??

Astounding
PROC Star

It looks like you need to add a semicolon at the end of the UPDATE statement.  The software thinks BY and COLUMN are names of additional data sets.

archana
Fluorite | Level 6

Yes it worked after adding the semicolon. Thank you!!

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 3046 views
  • 3 likes
  • 4 in conversation