SAS Base Programming for SAS 9 — Question 21
Given the SAS data set PEPM.STUDENTS:
PERM.STUDENTS NAME AGE -
--------- ------ Alfred 14
Alice13 -
Barbara13 -
Carol14 -
The following SAS program is submitted:
libname perm SAS data library;
data students;
set perm.students;
file file specification;
put name $15. @5 age 2.;
run;
What is written to the output raw data file?
Answer options
- A. ----I----10---I----20---I----30 Alfred 14 Alice 13 Barbara 13 Carol 14
- B. ----I----10---I----20---I----30 Alfr14 Alic13 Barb13a Carol 4
- C. ----I----10---I----20---I----30 Alfr14ed Alic130 Barb13ara Caro141
- D. ----I----10---I----20---I----30 Alfred14 Alice13 Barbara13
Correct answer: B
Explanation
The correct answer is B because the 'put' statement formats the names to fit within the specified width and appends the age directly after the name without a space. The other options are incorrect due to either incorrect formatting of names or ages, which do not adhere to the specified output structure.