EZ Study

Actuarial Biology Chemistry Economics Calculators Confucius Engineer
Physics
C.S.

SAS Programing Certification Exam
Practice Questions & Answer set-7

Practice Question 27

The following SAS program is submitted:
proc contents data = sasuser.airplanes;
run;

Which one of the following is produced as output?
A. the data portion of every data set in the SASUSER library
B. the data portion of the data set SASUSER.AIRPLANES only
C. the descriptor portion of every data set in the SASUSER library
D. the descriptor portion of the data set SASUSER.AIRPLANES only

Answer: D

Practice Question 28

A raw data file is listed below:
--------10-------20-------30
John McCloskey 35 71
June Rosesette 10 43
Tineke Jones 9 37

The following SAS program is submitted using the raw data file as input:

data work.homework;     infile 'file-specification';
Click to Get Those Highly Recommended SAS Programmers' Books
input name $ age height;     if age LE 10;
run;

How many observations will the WORK.HOMEWORK data set contain?
A. 0     B. 2     C. 3
D. No data set is created as the program fails to execute due to errors.

Answer: C This is a tricky question. The values for name have embedded blanks and also no length statement.

Practice Question 29

The SASDATA.BANKS data set has five observations when the following SAS program is submitted:

libname sasdata 'SAS-data-library';
data allobs;
set sasdata.banks;
capital=0;
do year = 2000 to 2020 by 5;
capital + ((capital+2000) * rate);
output;
end;
run;

How many observations will the ALLOBS data set contain?

A. 5     B. 15     C. 20     D. 25

Answer D Banks has 5 obs and then the do loop outputs for (20/5 + 1) times. Therefore 5*(20/5 + 1) is the observation count .

Practice Question 30

The SAS data set named COMPANY.PRICES is listed below:

COMPANY.PRICES

prodid price producttype sales returns

K12S 5.10 NETWORK 15 2
B132S 2.34 HARDWARE 300 10
R18KY2 1.29 SOFTWARE 25 5
3KL8BY 6.37 HARDWARE 125 15
DY65DW 5.60 HARDWARE 45 5
DGTY23 4.55 HARDWARE 67 2

The following SAS program is submitted:

libname company 'SAS-data-library';
data hware inter soft;
set company.prices (keep = producttype price);
if price le 5.00;
if producttype = 'HARDWARE' then output HWARE;

else if producttype = 'NETWORK' then output INTER;
else if producttype = 'SOFTWARE' then output SOFT;
run;

How many observations does the HWARE data set contain?
A. 0     B. 2     C. 4     D. 6

nswer: B The if price le 5.00; limits the obs to the below obs out of which HARDWARE has two obs.

Related links:
Continue to SAS Practice Exam Question Answer Set-8   SAS interview Questions Answers
Back to SAS Practice Exam Question Answer Set-6   SAS Tutorial   Statistics Tutorial