BookmarkSubscribeRSS Feed
olivia123456
Fluorite | Level 6
  1. The following data set information contains five variables name, sex, race, weight, and iq,
  • Using data set informationto create a SAS data set biothat contains three variables, name, sex, and race.
  • Using data set informationto create SAS data set personalthat contains name, weightand iq.
  • Given bioand personaldata sets, create the data set fullwith five variables.

 

Eric    m   White                      130  60

Mary   f    African American    110 130

Lou     m  Asian                     140 110

Frank  m  White                    160 150

Jen     f    White                       120 125

2 REPLIES 2
Reeza
Super User

Use the KEEP and DROP data set options. 

 

http://support.sas.com/documentation/cdl/en/ledsoptsref/69751/HTML/default/viewer.htm#p0vw9lyyxk1cxk...

 

http://support.sas.com/documentation/cdl/en/ledsoptsref/69751/HTML/default/viewer.htm#p0vw9lyyxk1cxk...

 

For the last one you'll need a MERGE statement. 

https://video.sas.com/detail/video/4572997800001/merging-sas-tables-in-a-data-step?autoStart=true&q=...

 

 

Give these a shot and if you need further help please post the code and an explanation of what's not working.


@olivia123456 wrote:
  1. The following data set information contains five variables name, sex, race, weight, and iq,
  • Using data set informationto create a SAS data set biothat contains three variables, name, sex, and race.
  • Using data set informationto create SAS data set personalthat contains name, weightand iq.
  • Given bioand personaldata sets, create the data set fullwith five variables.

 

Eric    m   White                      130  60

Mary   f    African American    110 130

Lou     m  Asian                     140 110

Frank  m  White                    160 150

Jen     f    White                       120 125


 

andreas_lds
Jade | Level 19

Interesting homework.

 

So you need one data step to create the datasets "bio" and "personal" and a second step to merge them to create "full". And to control which variables are written to each dataset, you will need one of the keywords already mentioned by @Reeza