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;

 

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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