New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

SAS A00-231 Exam - Topic 1 Question 16 Discussion

Actual exam question for SAS's A00-231 exam
Question #: 16
Topic #: 1
[All A00-231 Questions]

The following SAS program is submitted:

data work.test;

type='SQL';

if type='SAS' then description='SAS Program';

else description='other'; length description 8;

run;

What occurs when the program is submitted?

Select one:

Show Suggested Answer Hide Answer
Suggested Answer: D

Contribute your Thoughts:

0/2000 characters
Albina
11 days ago
C is the way to go. The variable Description is created as an 8-byte character variable and is assigned the value 'SAS Prog' in the DATA step.
upvoted 0 times
...
Ludivina
16 days ago
Haha, this question is a real brain-teaser! I'm going with B - the variable Description is created as a 5-byte character variable and is assigned the value 'SAS P' in the DATA step.
upvoted 0 times
...
Ruby
21 days ago
D seems like the right answer to me. The variable Description is created as an 11-byte character variable and the DATA step fails due to errors.
upvoted 0 times
...
Gary
26 days ago
I think the correct answer is C. The variable Description is created as an 8-byte character variable and is assigned the value 'SAS Prog' in the DATA step.
upvoted 0 times
...
Becky
1 month ago
I feel like the program should run without errors, but I’m confused about whether it would actually assign 'SAS Program' correctly with the length set to 8.
upvoted 0 times
...
Golda
1 month ago
This seems similar to a practice question we did where the length was defined, but I can't remember if it was supposed to fail or not.
upvoted 0 times
...
Mollie
1 month ago
I think the description variable should be 8 bytes since that's what the length statement specifies, but I can't recall if it truncates the string.
upvoted 0 times
...
Rozella
2 months ago
I remember something about the length statement affecting the variable size, but I'm not sure if it overrides the actual value assigned.
upvoted 0 times
...
Latonia
2 months ago
I'm feeling pretty confident about this one. The key is understanding how the length statement works in a DATA step. It sets the length of the variable, not the actual value. So even though the value is longer than 8 bytes, the variable will be truncated to 8 bytes, which means the answer is C.
upvoted 0 times
...
Christene
2 months ago
Okay, let me think this through step-by-step. First, the type variable is set to 'SQL'. Then, the if-else statement assigns 'SAS Program' or 'other' to the Description variable. Finally, the length statement sets the length to 8 bytes. So I think the answer is C, since the length will be truncated to 8 characters.
upvoted 0 times
...
Ona
2 months ago
Hmm, I'm a bit confused here. The length statement comes after the assignment of the value, so I'm not sure if that will actually set the length correctly. I might need to double-check the SAS documentation on how length statements work in this context.
upvoted 0 times
...
Laurel
2 months ago
I'm pretty sure the answer is C. The length statement sets the variable Description to 8 bytes, so it should be assigned 'SAS Prog' in the DATA step.
upvoted 0 times
...

Save Cancel