BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
robertrao
Quartz | Level 8

Hi,

I have two datasets and "variable name" TIME differs in both

I want to merge by ID and TIME and want to delete if its a duplicate occuring  in both.

How can this be the log?????????when only 14 records were common then I was expecting the WANT dataset to have (93+68=161)-14=147???????????

DATASET1 has 93 records

DATASET2 has 68 records

WANT has 133 records

TEST has 14 records

Please correct me???

data want test;

merge dataset1(in=a)   dataset2( in=b rename=(time1=time));

by ID TIME;

if a and b then output test;else output want;

run;

DATASET1                                     
ID     TIME                                  
101   27JUN2013:11:24

DATASET2
ID             TIME1
101       27JUN2013:11:24

1 ACCEPTED SOLUTION

Accepted Solutions
Fugue
Quartz | Level 8

If there are 14 records in common, then the total of non-matches will be (93-14)+(68-14)=133.

View solution in original post

1 REPLY 1
Fugue
Quartz | Level 8

If there are 14 records in common, then the total of non-matches will be (93-14)+(68-14)=133.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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