Hello all,
New SAS User. I have two datasets (Dataset 1 and Dataset 2). The datasets contain ID variables (ID Var 1 & ID Var 2) that corresponds to individuals. Dataset 1 includes a variable (Var X) that contains test results. All individuals in Dataset 1 are contained in Dataset 2 but Dataset 2 has some additional individuals.
What I’m trying to do is: if the individual exists in both Datasets 1 and 2, I would like to set Var Y equal to the test value in Var X. Of note, the datasets are large with millions of observations.
I don't know where to start here so any help would be greatly appreciated.
Regards,
Pat
Dataset 1 | | | Dataset 2 | |
ID Var 1 | Var X | | ID Var 2 | Var Y |
1 | 1 | | 1 | |
2 | 1 | | 2 | |
3 | 0 | | 3 | |
4 | 0 | | 4 | |
5 | 0 | | 5 | |
6 | 2 | | 6 | |
7 | 2 | | 7 | |
8 | 2 | | 8 | |
9 | 0 | | 9 | |
| | | 10 | |
| | | 11 | |
| | | 12 | |
| | | 13 | |
| | | 14 | |
| | | 15 | |
| | | 16 | |