BookmarkSubscribeRSS Feed
kumaabi
Fluorite | Level 6

The SAS data set mylib.room has five variables (name, sex, age, height, and weight) and 19 observations (9 observations with sex='F' and 10 observations with sex='M').
Libname mylib 'C:\STA575\SASData';
Data work.female(drop=height) work.others(keep=name weight height);
Set mylib.room;
If sex='F' then output work.female;
Output work.others;
Run;


 What is the input data set?
 How many output data sets are being created?
 How many variables are in work.female?
 How many observations are in work.others?

13 REPLIES 13
MarkusWeick
Barite | Level 11

Hi @kumaabi,

have you run the program? What ist your problem?

Best

Markus

Please keep the community friendly.
Like posts you agree with or like. Mark helpful answers as “accepted solutions”. Generally have a look at https://communities.sas.com/t5/Getting-Started/tkb-p/community_articles
MarkusWeick
Barite | Level 11

Hi @kumaabi,

a got offer for a free learning unit to the basics can be found here:

https://support.sas.com/edu/schedules.html?crs=PROG1

Best

Markus

Please keep the community friendly.
Like posts you agree with or like. Mark helpful answers as “accepted solutions”. Generally have a look at https://communities.sas.com/t5/Getting-Started/tkb-p/community_articles
MarkusWeick
Barite | Level 11

Hi @kumaabi,

I just saw Tom's advise, which I think is really good: Please help me to Answer the questions below - SAS Support Communities

Best

Markus

Please keep the community friendly.
Like posts you agree with or like. Mark helpful answers as “accepted solutions”. Generally have a look at https://communities.sas.com/t5/Getting-Started/tkb-p/community_articles
kumaabi
Fluorite | Level 6

The SAS data set mylib.room has five variables (name, sex, age, height, and weight) and 19 observations (9 observations with sex='F' and 10 observations with sex='M').
Libname mylib 'C:\STA575\SASData';
Data work.female(drop=height) work.others(keep=name weight height);
Set mylib.room;
If sex='F' then output work.female;
Output work.others;
Run;


Please help me to Answer the questions below
 What is the input data set?
 How many output data sets are being created?
 How many variables are in work.female?
 How many observations are in work.others?

Tom
Super User Tom
Super User

Give us you answers (and why you think they are the right answers) and we can confirm them or explain why they are not right.

 

Spoiler
If you want to try running the code yourself just change mylib.room to sashelp.class and run it in any SAS session.
kumaabi
Fluorite | Level 6
The reason I asked here because I dont know anything about sas. I have to take it because its a mandatory course in my university. This is an assignment question
Tom
Super User Tom
Super User

@kumaabi wrote:
The reason I asked here because I dont know anything about sas. I have to take it because its a mandatory course in my university. This is an assignment question

I assume they assigned you something to read (or watch) so you should know something about SAS by now.

And even you don't you can still just read the code as if it was English and take a wild-a**-guess at some of the questions.  Don't worry about being wrong, we aren't going to grade you.

Kurt_Bremser
Super User

@kumaabi wrote:
The reason I asked here because I dont know anything about sas. I have to take it because its a mandatory course in my university. This is an assignment question

Please do not try lying to us. Since you were able to write the code posted here, you DO have SAS knowledge.

v307086
Calcite | Level 5
Hi,

What is the input data set? - the input dataset you can see in the set statement i.e.: mylib.room
How many output data sets are being created? - Two output datasets will be created: females and others
How many variables are in work.female? - 4 variables: name,sex, age, weight
How many observations are in work.others? - 19 observations
Sajid01
Meteorite | Level 14

Hello
As you are new to SAS pease this is a good introduction for you https://support.sas.com/resources/papers/proceedings11/054-2011.pdf .

JBailey
Barite | Level 11
Hey, ChatGPT can answer this...

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 13 replies
  • 1952 views
  • 1 like
  • 7 in conversation