@Babloo wrote:
How to convert the following merge step into joins. I just given the structure of the merge and in similar fashion I need to achieve the same in Joins.
Data merge;
If a(in=x) b(in=y);
By id;
If x and y;
Then;
Do;
F=7;
End;
If x;
Then;
Do;
F=3;
End;
If y;
Then;
Do;
F=9;
End;
Run;
Because of the way that SAS treats same-named variables in different data sets without a complete example for data in all data sets involved it is not possible to determine even if a similar join is possible. Since you do not actually show a MERGE statement (or SET or other statement that actually indicates source data sets) in your example it is even harder. You example code will throw multiple errors as is.
Plus, post code in code box opened with the forum's {I} menu icon so formatting such as indents are preserved.
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!
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.