Hi,
I would like to merge two data set and also create a new variable by using proc sql. This is my code but am getting the following syntax error.
The WHERE clause needs a valid Boolean expression.
month_fu-(mondx1+12) as month_std
is not a Boolean expression, it rather looks like a part of the SELECT clause.
Looks like you want to create a new variable month_std. I would write the code as follows
proc sql;
create table final_table_0607 as
select *,x.month_fu-(x.mondx1+12) as month_std
from case_07 as x left join mth_0607 as y
on x.bene_id = y.bene_id;
quit;
I have taken x.month_fu and x.modx1 as an example assuming it comes from the first table. You can take what ever is applicable in your case (x or y).
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.