Hello Team,,
I have several left joins as shown and while joining i want to write a condition so unwanted records are not coming up in the final output.
I cant at the same time remove thoswe after the joins are made because then it might remove some of the records we want to keep
Proc sql;
create table want as
select *
from have as hv
left join table1 as tab1(where=var1 ne .)) on tab1.ID=hv.ID
left join...
left join....
where
quit;
run;
Besides mismatched )
This part
left join table1 as tab1(where=var1 ne .))
maybe should be
left join (select * from table1 where=var1 ne . ) as tab1
Ok. You haven't provided enough details to understand what you're having issues with or what you need help with.
Please post sample input/output data as well as details of how you want your filter to work and why WHERE clauses or ON isn't working.
Is it just a syntax problem
Proc sql;
create table want as
select *
from
have as hv left join
table1(where=(var1 ne .)) as tab1 on tab1.ID=hv.ID left join...
where ...;
quit;
Besides mismatched )
This part
left join table1 as tab1(where=var1 ne .))
maybe should be
left join (select * from table1 where=var1 ne . ) as tab1
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.