BookmarkSubscribeRSS Feed
lokeshbm
Calcite | Level 5

Hi,

 

I need the below step in Proc Sql

 

data newdata;

merge dset1(in=a) dset2(in=b);

by subjid visit location pin;

if a and not b;

run;

 

 

1 REPLY 1
LinusH
Tourmaline | Level 20
This must be the oldest SAS question. The are literally thousands of papers and have been discussed Om this forum several times. Do a search her and on support.Sas.com.
Short answer : left join, but it depends on your data.
Data never sleeps

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
  • 1 reply
  • 3197 views
  • 0 likes
  • 2 in conversation