Data set A | Data set B |
Id X Y | Id X Z |
1 10 11 2 14 . | 1 . 4 3 15 5 3 17 . |
Data set C
|
| Id | X | Y | Z |
(1) | Data C; set A B;
|
|
|
|
|
(2) | Data C; set A; set B;
|
|
|
|
|
(3) | Data C; set A B; by Id;
|
|
|
|
|
(4) | Data C; merge A B;
|
|
|
|
|
(5) | Data C; merge A B; by Id;
|
|
|
|
|
(6) | Data C; update A B; by Id;
|
|
|
|
|
(7) | Data C; set B; If X=. then set A; Else Y=mean(X, Z);
|
|
|
|
|
I was able to create the two data sets. I am confused to what the table is asking from me. I don't understand how to answer it or how to use the set function.
Try running each of the programs (with a RUN; statement at the end of each), and see what the results are.
The SET statement reads observations from a SAS data set. You will 100% need to learn that.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.