BookmarkSubscribeRSS Feed
andy_wk
Calcite | Level 5

It should be an easy one but I'm stuck

Proc sql;  UPDATE dicofr SET 

dicofr.period = correspondance.period

FROM  dicofr INNER JOIN correspondance ON dicofr.name_fic = correspondance.name_fic;

I was thinking my update would be done but I got this error instead.

271  proc sql;

272  update dicofr

273  set dicofr.period = correspondance.period - 73 76

ERROR 73-322: Expecting an =.  ERROR 76-322: Syntax error, statement will be ignored.

I've tried with a straight join with a select

proc sql; SELECT * FROM dicofr INNER JOIN correspondance ON dicofr.nom_fic=correspondance.nom_fic;

The select is fine.

How come?

Is my SQL query not correct? I don't think so ...

Edited: It seems the update I want to do is not possible. Is there a way to do what I want with SAS language?

1 REPLY 1
andy_wk
Calcite | Level 5

I found my answer.

proc sql;

     update dicofr as h1

     set period=(select period from correspondance as h2 where h1.name_fic=h2.name_fic)

     where name_fic in (select name_fic from correspondance);

quit;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1 reply
  • 1257 views
  • 3 likes
  • 1 in conversation