Your ON join-conditions are not syntactically correct. They should read ON T1.something1 = T2.something2.
best way to understand by making up data and try out various scenarios. This will tremendously increase your knowledge. check with on clause initially then try where clauses. Nothing better than learning by doing.
And while you're doing your tests, as @kiranv_ suggested, also try a solution with sort and data steps, where you do the joins piecemeal.
With larger datasets, the overall performance might surprise you.
Caveat: This is only possible with 1-to-many, not with many-to-many relationships, where SQL is needed for the cartesian join.
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!
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.