EZ Study

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

SAS Programing Certification Exam
Practice Questions & Answer set-31

Practice Question 152

The following SAS program is submitted:
data work.staff;
JobCategory = 'FA';
JobLevel = '1';

JobCategory = JobCategory || JobLevel;
run;
Which one of the following is the value of the variable JOBCATEGORY in the output data set?
A. FA     B. FA1     C. FA 1     D. ' ' (missing character value)

Answer is A. Notice the first statment define the length of the variable.

Practice Question 153

The following SAS program is submitted:
data work.one;
x = 3;     y = 2;     z = x ** y;
run;
Which one of the following is the value of the variable Z in the output data set?
A. 6     B. 9     C. . (missing numeric value)
D. The program fails to execute due to errors.

Answer is B.

Practice Question 154

The SAS data set named WORK.TEST is listed below:
capacity airplanetype staff
150 Large 10
Which one of the following SAS programs created this data set?
A. data work.test;
capacity = 150;
if 100 le capacity le 200 then
airplanetype = 'Large' and staff = 10;
else airplanetype = 'Small' and staff = 5;   run;
B. data work.test;
capacity = 150;
if 100 le capacity le 200 then
do;
airplanetype = 'Large';
staff = 10;
end;
else
do;
airplanetype = 'Small';
staff = 5;
end;   run;
C. data work.test;
capacity = 150;
if 100 le capacity le 200 then
do;
airplanetype = 'Large';   staff = 10;
else
do;
airplanetype = 'Small';
staff = 5;
end;   run;
D. data work.test;
capacity = 150;
if 100 le capacity le 200 then;
airplanetype = 'Small';
staff = 5;
else;
airplanetype = 'Large';
staff = 10;   run;

Answer is B.

Practice Question 155

The following SAS program is submitted:
data work.flights;
destination = 'cph';
select(destination);
when('LHR') city = 'London';
Click to Get Those Highly Recommended SAS Programmers' Books
when('CPH') city = 'Copenhagen';
otherwise city = 'Other';
end; run;
Which one of the following is the value of the CITY variable?
A. Other   B. Copenh   C. Copenhagen   D. ' ' (missing character value)

Answer is A.

Related links:

Continue to SAS Practice Exam Question Answer Set-32   SAS interview Questions Answers
Back to SAS Practice Exam Question Answer Set-30   SAS Tutorial   Statistics Tutorial