Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

SAS Exam A00-215 Topic 13 Question 44 Discussion

Actual exam question for SAS's A00-215 exam
Question #: 44
Topic #: 13
[All A00-215 Questions]

Given the following code:

Which variables are created with the BY statement?

Show Suggested Answer Hide Answer
Suggested Answer: A

In SAS, when you use a BY statement in a DATA step, SAS creates two temporary variables for each variable listed in the BY statement: one to indicate the first occurrence (FIRST.variable) and another to indicate the last occurrence (LAST.variable) of the value within the BY-group. Given the provided code and assuming that State is the variable used in the BY statement, SAS will create First.State and Last.State. Thus, option A is correct.


SAS documentation on the BY statement, SAS Institute.

Contribute your Thoughts:

Rene
2 months ago
Haha, this is an easy one. If you can't figure out that C is the right answer, you might want to rethink your career choice!
upvoted 0 times
Emelda
1 months ago
D) First. and Last.
upvoted 0 times
...
Kris
1 months ago
C) First_State and Last_State
upvoted 0 times
...
Bette
1 months ago
B) First. State and Last. State
upvoted 0 times
...
Fatima
2 months ago
A) State. First and State. Last
upvoted 0 times
...
...
Goldie
2 months ago
This question is pretty straightforward. The BY statement is clearly creating new variables with the names First_State and Last_State.
upvoted 0 times
Lynelle
2 months ago
C) First_State and Last_State
upvoted 0 times
...
Christa
2 months ago
B) First. State and Last. State
upvoted 0 times
...
Marge
2 months ago
A) State. First and State. Last
upvoted 0 times
...
...
Daron
2 months ago
I think the answer is D) First. and Last. because those are the variables created by the BY statement
upvoted 0 times
...
Dante
3 months ago
I agree with Vivienne. The code shows that the variables created are First_State and Last_State, not the options in A, B, or D.
upvoted 0 times
Flo
2 months ago
Yes, I agree. It's not State. First and State. Last as mentioned in the options.
upvoted 0 times
...
Haley
2 months ago
I think you're right, the variables created are First_State and Last_State.
upvoted 0 times
...
...
Clorinda
3 months ago
But the BY statement creates variables for the first and last observations in a BY group, so A) makes more sense
upvoted 0 times
...
Annette
3 months ago
I disagree, I believe the answer is B) First. State and Last. State
upvoted 0 times
...
Clorinda
3 months ago
I think the answer is A) State. First and State. Last
upvoted 0 times
...
Vivienne
3 months ago
The correct answer is C) First_State and Last_State. The BY statement creates new variables with the prefix of the variable names.
upvoted 0 times
Chantell
2 months ago
You are right, the BY statement creates new variables with the prefix of the variable names.
upvoted 0 times
...
Socorro
3 months ago
No, I believe it is C) First_State and Last_State
upvoted 0 times
...
Carri
3 months ago
I think the correct answer is A) State. First and State. Last
upvoted 0 times
...
...

Save Cancel