EZ Study

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

SAS Programing Certification Exam
Practice Questions & Answer set-47

Practice Question 225

The SAS data sets WORK.EMPLOYEE and WORK.SALARY are shown below:
WORK.EMPLOYEE WORK.SALARY
fname age name salary
Bruce 30 Bruce 25000
Dan 40 Bruce 35000
Dan 25000
The following SAS program is submitted:
data work.empdata;
by fname;

totsal + salary;
run;
Which one of the following statements completes the merge of the two data sets by the FNAME variable?
A. merge work.employee   work.salary (fname = name);
B. merge work.employee   work.salary (name = fname);
C. merge work.employee   work.salary (rename = (fname = name));
D. merge work.employee   work.salary (rename = (name = fname));

Answer is D. Because the two data sets are merged by fname variable. You need to rename the name variable of the salary data set to fname.

Practice Question 226

The SAS data sets WORK.EMPLOYEE and WORK.SALARY are listed below:
WORK.EMPLOYEE WORK.SALARY
fname age fname salary
Bruce 30 Bruce 25000
Dan 40 Bruce 35000
Dan 25000
The following SAS program is submitted:
data work.empdata;
merge work.employee
work.salary;
Click to Get Those Highly Recommended SAS Programmers' Books
by fname;
totsal + salary;
run;
How many variables are output to the WORK.EMPDATA data set?
A. 3     B. 4     C. 5    
D. No variables are output to the data set as the program fails to execute due to errors.

Answer is B.

Practice Question 227

The contents of two SAS data sets named EMPLOYEE and SALARY are listed below:
How many observation are in EMPLSAL dataset
data emplsal;
merge employee (in=ine) salary(in=ins);
by name;
if ine and ins;
run;

Choices are
A. 4     B. 3     c. 2     D. 1
Answer is A.

Practice Question 228

The following SAS program is submitted:
data numrecords;
infile 'file-specification';
input @1 patient $15.
relative $ 16-26 @;
if relative = 'children' then
input @54 diagnosis $15. @;
else if relative = 'parents' then
input @28 doctor $15.
clinic $ 44-53
@54 diagnosis $15. @;
input age;
run;
How many raw data records are read during each iteration of the DATA step during execution?
A. 1   B. 2   C. 3   D. 4

Answer is A.

Related links:

Continue to SAS Practice Exam Question Answer Set-48   SAS interview Questions Answers
Back to SAS Practice Exam Question Answer Set-46   SAS Tutorial   Statistics Tutorial