EZ Study

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

SAS Programing Certification Exam
Practice Questions & Answer set-41

Practice Question 195

The following SAS program is submitted:

data work.flights;
destination = 'CPH';
select(destination);
when('LHR') city = 'London';

when('CPH') city = 'Copenhagen';
otherwise;
end;
run;

Which one of the following is the value of the CITY variable?

A. London
B. Copenh
C. Copenhagen
D. ' ' (missing character value)

Answer : B It depends on first obs london it has length 6 so city variable length is 6

Practice Question 196

The following SAS program is submitted:

data work.total;
set work.salary(keep = department wagerate);
by department;
if first.department then payroll = 0;
Click to Get Those Highly Recommended SAS Programmers' Books
payroll + wagerate;     if last.department;
run;

The SAS data set WORK.SALARY, currently ordered by DEPARTMENT, contains 100 observations for each of 5 departments. Which one of the following represents how many observations the WORK.TOTAL data set contains?

A. 5     B. 20     C. 100     D. 500

Practice Question 197

The following SAS program is submitted:

data work.retail;
cost = '20000';
total = .10 * cost;
run;

Which one of the following is the value of the variable TOTAL in the output data set?

A. 2000     B. '2000'     C. . (missing numeric value)     D. ' ' (missing character value)

Practice Question 198

The following SAS program is submitted:

libname sasdata 'SAS-data-library';

data test;
set sasdata.chemists;
if jobcode = 'chem3'
then description = 'Senior Chemist';
else description = 'Unknown';
run;

A value for the variable JOBCODE is listed below:

JOBCODE
---------------
CHEM3

Which one of the following values does the variable DESCRIPTION contain?

A. chem3     B. Unknown     C. Senior Chemist     D. ' ' (missing character value)