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 

 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 841 views
  • 0 likes
  • 3 in conversation