@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.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.