Programming the statistical procedures from SAS

How to determine if my join is bringing everything ?

Reply
Frequent Contributor
Posts: 80

How to determine if my join is bringing everything ?

Hi I have 2 tables that I need to join they don't have like variables ... what I'm using is id and date and time.. here is example

From table A join table B
On B.ID = A.Id
And a.date=b.date and a.time between b.time1 and b.time2
);run:


the data looks like this table A
Id. Date time

A. 05/26/16. 11:53:00
B. 05/29/16. 02:33:00

table B
Id. Date time. Time1. Time2
11
A. 05/26/16. 11:55:00 11:50:00. 12:00:00
B. 05/29/16. 02:35:00. 02:35:00. 02:40:00


What I'm doing is if the time from table A fell within the time range from table B time1 and time 2 ...I'm getting results but not sure if I'm getting everything thanks again for the help


Esteemed Advisor
Posts: 5,156

Re: How to determine if my join is bringing everything ?

Your syntax looks OK given that I understood your requirement.
If you want to feel confident with the result, control it.
Start with the result - are the returned records correct?
The look to you source data, pick rows and see if they would match your criteria, and compare with your result.
Data never sleeps
Grand Advisor
Posts: 16,889

Re: How to determine if my join is bringing everything ?

You need to develop test cases. 

Then check that each case is returning the correct number

of records. Make sure to test edge cases - ones with no

matches either by ID or by time, missing data, and/or a large number of matches. 

 

Also, test each case individually

and then as a set. 

Ask a Question
Discussion stats
  • 2 replies
  • 189 views
  • 1 like
  • 3 in conversation