DATA Step, Macro, Functions and more

Create new variables grouping data

Reply
Contributor
Posts: 31

Create new variables grouping data

33.)
data temp;
merge test1(keep = ID)
test2(keep = ID NAME CLASS AGE);
by ID;
keep = ID NAME;
run;
Variables in output dataset?
A.) ID NAME
B.) NAME ID
C.) ID NAME CLASS AGE
D.) Syntax error
Answer: b

 

Won't keep = create an error?

What it it was just keep = ID NAME?

Respected Advisor
Posts: 3,124

Re: Create new variables grouping data

Yes. I believe you are correct and the answer is wrong. 'Keep=' is only valid when used as a data set option. 

Contributor
Posts: 31

Re: Create new variables grouping data

Yes.
Also what if it was
keep ID NAME
?
How to choose the correct answer in option A and B?
Ask a Question
Discussion stats
  • 2 replies
  • 177 views
  • 1 like
  • 2 in conversation