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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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