BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SAS93
Quartz | Level 8
I'm trying to merge 2 different datasets of different sizes (# OBS). They each share a common variable, but I had to rename & change one of them so their formats and variable names matched. >> I want to merge and keep only the obs that are found in the smaller dataset << I found a suggestion elsewhere to do the following in order to accomplish that: Data OrgList.match18a; Merge temp18 (IN = a) list18 (IN = b); By CommonVar; If a and b; Run; But NO obs are written to that new dataset; SAS is reading the other two datasets just fine and the renaming/reformatting is fine after I checked it. Without the "if a and b", the new dataset has a combined # of all obs from both datasets. What do I do to fix this?
1 ACCEPTED SOLUTION

Accepted Solutions
SAS93
Quartz | Level 8

Just kidding, I solved my own problem. 

 

One-to-one-merging worked. Not sure why the other method was even suggested to accomplish this. 

 

Data OrgList.match18a;
Set temp18;
Set hosp2018;
Run;

 

 

View solution in original post

2 REPLIES 2
SAS93
Quartz | Level 8
I don't know what happened to the formatting for this post. My apologies.
SAS93
Quartz | Level 8

Just kidding, I solved my own problem. 

 

One-to-one-merging worked. Not sure why the other method was even suggested to accomplish this. 

 

Data OrgList.match18a;
Set temp18;
Set hosp2018;
Run;

 

 

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1425 views
  • 0 likes
  • 1 in conversation