DATA Step, Macro, Functions and more

if a and not b in Proc Sql

Reply
Occasional Contributor
Posts: 7

if a and not b in Proc Sql

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;

 

 

Super User
Posts: 5,424

Re: if a and not b in Proc Sql

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
Ask a Question
Discussion stats
  • 1 reply
  • 792 views
  • 0 likes
  • 2 in conversation