EZ Study

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

SAS Programing Certification Exam

### Practice Question 229

A raw data file is listed below:
RANCH,1250,2,1,Sheppard Avenue,"\$64,000"
SPLIT,1190,1,1,Rand Street,"\$65,850"
CONDO,1400,2,1.5,Market Street,"80,050"
TWOSTORY,1810,4,3,Garris Street,"\$107,250"
RANCH,1500,3,3,Kemble Avenue,"\$86,650"
SPLIT,1615,4,3,West Drive,"94,450"
SPLIT,1305,3,1.5,Graham Avenue,"\$73,650"
The following SAS program is submitted using the raw data file as input:
data work.condo_ranch;
infile 'file-specification' dsd;
input style \$ @;
if style = 'CONDO' or style = 'RANCH';

>input sqfeet bedrooms baths street \$ price : dollar10.;
run;
How many observations does the WORK.CONDO_RANCH data set contain?
A. 0     B. 3     C. 5     D. 7

### Practice Question 230

A raw data file is listed below:
RANCH,1250,2,1,Sheppard Avenue,"\$64,000"
SPLIT,1190,1,1,Rand Street,"\$65,850"
CONDO,1400,2,1.5,Market Street,"80,050"
TWOSTORY,1810,4,3,Garris Street,"\$107,250"
RANCH,1500,3,3,Kemble Avenue,"\$86,650"
SPLIT,1615,4,3,West Drive,"94,450"
SPLIT,1305,3,1.5,Graham Avenue,"\$73,650"
The following SAS program is submitted using the raw data file as input:
data work.condo_ranch;
infile 'file-specification' dsd;
input style \$ @;
if style = 'CONDO' or style = 'RANCH' then
Click to Get Those Highly Recommended SAS Programmers' Books
input sqfeet bedrooms baths street \$ price : dollar10.;
run;
How many observations does the WORK.CONDO_RANCH data set contain?
A. 0     B. 3     C. 5     D. 7

### Practice Question 231

The contents of the raw data file FURNITURE are listed below:
--------10-------20-------30
chair,,table
chair,couch,table

The following SAS program is submitted:
data stock;
infile 'furniture' dsd;
input item1 \$ item2 \$ item3 \$;
run;
Which one of the following is the value of the variable named ITEM2 in the first observation of the output data set?
A. table     B. ,table     C. . (missing numeric value)
D. ' ' (missing character value)

### Practice Question 232

The following SAS program is submitted and reads 100 records from a raw data file:
data work.total;
infile 'file-specification' end = eof;
input name \$ salary;
totsal + salary;
run;
Which one of the following IF statements writes the last observation to the output data set?
A. if end = 0;     B. if eof = 0;     C. if end = 1;     D. if eof = 1;

Answer is D. End is sas keyword which will become true when SAS reads last record of a dataset. This value you cannot use directly in your program, so we create a alias name eof (end of file), but you can name it anything. EOF will carry the same value as internal variable END. So as we know 1=true and 0= false. if EOF = 1; will output only the last observation.