Help using Base SAS procedures

proc sql update statement with inner join

Reply
Frequent Contributor
Posts: 111

proc sql update statement with inner join

Can any one explain the inner join on condition (ON a.date=b.DATE - 1 YEAR) in below query

proc sql;
alter table k.data_products
add var1 NUM(8)
add var2 NUM(8)
add var3 NUM(8)
add var4 NUM(8)
add var5 NUM(8);

update k.data_products1 a
set a.var1=b.c_var1,a.var2=b.c_var2,a.var3=b.c_var3
FROM k.data_products1 a INNER JOIN k.data_products2 b
ON a.date=b.DATE - 1 YEAR;

Super User
Posts: 5,256

Re: proc sql update statement with inner join

That isn't valid syntax.

Ask the person who created the code.

Data never sleeps
Super User
Posts: 6,938

Re: proc sql update statement with inner join

Since it's a syntax error, there's nothing to explain.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Ask a Question
Discussion stats
  • 2 replies
  • 676 views
  • 0 likes
  • 3 in conversation