I'm going through the results of a practice exam with the following question:
Given the SAS data set PERM.STUDENTS:
PERM.STUDENTS NAME AGE
--------- ------ Alfred 14
Alice13
Barbara13
Carol14
The following SAS program is submitted:
libname perm ‘SAS data library’;
data students;
file ‘file specification’;
put name $15. @5 age 2.;
run;
What is written to the output raw data file?
The correct response is listed below:
Response:
----I----10---I----20---I----30
Alfr14
Alic13
Barb13a
Carol 4
I think I understand the first two (i.e. Alfr14 and Alic13), but I'm not sure why the second answer shouldn't be Barb1 or Barb14 and the third Caro14.
Would someone mind explaining the answer and possibly correcting it if it is incorrect?
Barb13a because put first puts the name: Barbara then goes to column 5 (the @5) and prints the age of 13.
I suspect there's something odd about the actual values of name and age for the Carol14 that we can't see as we don't have the data set.
This is the exact question as it was asked. There was no additional information. I think there might have been a typographical error.
I did a web search and page SAS Base Certification: Base SAS 88 found this question but the response choice displayed was
Alfr14
Alic13
Barb13a
Caro14
note the difference from your post.
Interesting. Most of them make sense to me except for the Barb13a. Why is there a trailing 'a' at the end?
The trailing "a" is the last character in "Barbara". Writing AGE replaced columns 5 and 6, but didn't replace column 7.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.