BookmarkSubscribeRSS Feed
Andrew1
Calcite | Level 5

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;

set perm.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?

5 REPLIES 5
ballardw
Super User

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.

Andrew1
Calcite | Level 5

This is the exact question as it was asked. There was no additional information. I think there might have been a typographical error.

ballardw
Super User

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.

Andrew1
Calcite | Level 5

Interesting. Most of them make sense to me except for the Barb13a. Why is there a trailing 'a' at the end?

Astounding
PROC Star

The trailing "a" is the last character in "Barbara".  Writing AGE replaced columns 5 and 6, but didn't replace column 7.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 929 views
  • 0 likes
  • 3 in conversation