I am trying to Merge two datasets using SAS Enterprise Miner Merge node using a common ID-Student_ID.
I want all records from dataset 1 merged with only the records that has a matching ID entry to data set 1 from the second data set .
Can someone help me to do this?. Right now I get all records from dataset 2 merged to dataset 1
You can use the filter node either before or after the merge. In my example I merged on some predictions values, so the records that did not have a value for phat (my prediction variable) I filtered out. This gave me a dataset with only the rows I wanted.
Just be sure to set the properties for Class and interval variables to NONE and click on the ellipse (indicated below) to specify the filter you want.
Here's what my filter looks like for phat
You can also use the SAS code node to filter. Here's a simple example of how that would work.
Catch the SAS Global Forum keynotes, announcements, and tech content!
sasglobalforum.com | #SASGF
I don't believe you can do this in the merge. You may try filtering either after or before to get your result.
I'm not clear if you are looking for an inner join, left or right join based on your post. If you can clarify I may be able to give a more specific answer.
Catch the SAS Global Forum keynotes, announcements, and tech content!
sasglobalforum.com | #SASGF
Thank you for the reply.
I'm interested in left join as well as inner join in this case.
If I can do both or either one that would be great.
Right now I'm getting a full join.
Is there any way to atleast filter out the records related to the ID in first set?
You can use the filter node either before or after the merge. In my example I merged on some predictions values, so the records that did not have a value for phat (my prediction variable) I filtered out. This gave me a dataset with only the rows I wanted.
Just be sure to set the properties for Class and interval variables to NONE and click on the ellipse (indicated below) to specify the filter you want.
Here's what my filter looks like for phat
You can also use the SAS code node to filter. Here's a simple example of how that would work.
Catch the SAS Global Forum keynotes, announcements, and tech content!
sasglobalforum.com | #SASGF
Thank you 🙂
This did it!
I was about to spend a lot of time to do it manually with Python. This saved a lot of my time
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!
Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.
Find more tutorials on the SAS Users YouTube channel.