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.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.