BookmarkSubscribeRSS Feed
Ihsan-Mahdi
Quartz | Level 8

Hello,

I have a data set with individuals identified with a unique ID number. There are multiple records for the same individual with different date/time values. I'm trying to identify duplicate records by setting a 12 hour difference as the cutoff between non-duplicate records. Not sure how to calculate the difference between the values related to a single unique ID!

Any suggestions?

 

Thank you 

3 REPLIES 3
PaigeMiller
Diamond | Level 26

Show us a portion of the data, where you provide the data as SAS data step code which you can type in yourself, or by following these instructions. Show us the desired output from this data.

--
Paige Miller
Ihsan-Mahdi
Quartz | Level 8
I'm sorry but my data contains PHIs and I can't share publicly
ballardw
Super User

@Ihsan-Mahdi wrote:
I'm sorry but my data contains PHIs and I can't share publicly

Anything for an identifier will do, ABC, PDQ, Moose and Squrrel. So make some up with some datetime values that will be similar to your data. The key bits will the datetime variable(s), the structure of the data and the desired output for a given example.

 

The INTCK function will return counts of intervals. Hours between two datetime values would be:

Hours = Intck('hour',datetime1, datetime2);

if the datetime2 is before datetime1 you get a negative number of hours.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 349 views
  • 0 likes
  • 3 in conversation