EZ Study

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

SAS Programing Certification Exam
Practice Questions & Answer set-36

Practice Question 174

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;
Click to Get Those Highly Recommended SAS Programmers' Books
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

Answer is B.

Practice Question 175

The following SAS program is submitted:
data allobs;
set sasdata.origin (firstobs = 75 obs = 499);   run;
The SAS data set SASDATA.ORIGIN contains 1000 observations.
How many observations does the ALLOBS data set contain?
A. 424     B. 425     C. 499     D. 1000

Answer is B.

Practice Question 176

The following SAS program is submitted:
data _null_;
set old (keep = prod sales1 sales2);
file 'file-specification';
put sales1 sales2;   run;
Which one of the following default delimiters separates the fields in the raw data file created?
A. : (colon)     B. (space)     C. , (comma)     D. ; (semicolon)

Answer is B.

Practice Question 177

The following SAS program is submitted:
data _null_;
set old;
put sales1 sales2;   run;
Where is the output written?
A. the SAS log   B. the raw data file that was opened last

C. the SAS output window or an output file   D. the data set mentioned in the DATA statement

Answer is A.

Practice Question 178

The contents of the raw data file TEAM are listed below:
--------10-------20-------30
Janice 10
Henri 11
Michael 11
Susan 12
The following SAS program is submitted:
data group;
infile 'team';
input name $15. age 2.;
file 'file-specification';
put name $15. +5 age 2.;   run;
Which one of the following describes the output created?
A. a raw data file only
B. a SAS data set named GROUP only
C. a SAS data set named GROUP and a raw data file
D. No output is generated as the program fails to execute due to errors.

Answer is C. Infile and input statements are used to read data from raw data file. File and put statements are used to write data to raw data file. In our example later is happening, so a raw data file is created and as data step is creating a dataset (it is not data _null_), it will create an output dataset too. So the answer is C raw data file and group dataset

Related links:

Continue to SAS Practice Exam Question Answer Set-37   SAS interview Questions Answers
Back to SAS Practice Exam Question Answer Set-35   SAS Tutorial   Statistics Tutorial