BookmarkSubscribeRSS Feed
olivia123456
Fluorite | Level 6
  1. Data sets A and B are showing below, apply various SET, MERGE, and UPDATE statements to determine what is contained in the data set C:

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);

 

 

 

 

 

 

 

 

 

 

 

3 REPLIES 3
Astounding
PROC Star
Are you unable to create the two data sets?

Are you unable to run any of the 7 programs?
olivia123456
Fluorite | Level 6

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.

Astounding
PROC Star

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.

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1115 views
  • 3 likes
  • 2 in conversation