BookmarkSubscribeRSS Feed
Sultana
Calcite | Level 5
I have two data sets in one data SSN zip code and address and city are provided and in other ssn and rank codes are provided after merging both the data sets I am not get all the zip code some are missing
My code is merge
Data 1(in=a) Data 2 (in =b)
If a;
I also tried with if b but that is not what I need
I need a code so that I can get all the zip codes from data 1

Please suggest
4 REPLIES 4
Shmuel
Garnet | Level 18

Can you provide a sample of both datasets where the merge outcome result with a missing zip code?

PeterClemmensen
Tourmaline | Level 20

Show us your data.

Astounding
PROC Star
The code you posted could not possibly be your real code. If you want real help, post your real code.
Tom
Super User Tom
Super User

Sounds like you want to merge by SSN.  Make sure to include the BY statement or else the MERGE statement will just match the observations in the order they appear, whether the SSN values match or not.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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
  • 4 replies
  • 1049 views
  • 0 likes
  • 5 in conversation