@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.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: