Questions:
1. A SAS print procedure output of the work.levels data set is listed below:
obs name level
1 Frank 1
2 Joan 2
3 Sui 2
4 Jose 3
5 Burt 4
6 Kelly .
7 Juan 1
The following SAS program is summited:
Data work.expertise;
set work.levels;
if level = . then expertise ="Unkown';
else if level =1 then expertise = 'Low';
else if level = 2 or 3 then expertise = 'Medium';
else expertise = 'High';
run;
which of the following values does the variable EXPERTISE contain:
A. Low, Medium, and High only
B. Low, Medium, and Unknown only
C. Low, Medium. High and Unknown only
D. Low, Medium. High, Unknown and ' ' (missing character value)
Answer B
why no 'high' and Burt 4 is evaluted to 'Medium' after run the result?
2. A frequency report of the variable Jobcode in the Work.Actors data set is listed
below.
Jobcode Frequency Percent Cumulative
Frequency Cumulative
Percent
Actor I 2 33.33 2 33.33
Actor II 2 33.33 4 66.67
Actor III 2 33.33 6 100.00
Frequency Missing = 1
The following SAS program is submitted:
data work.joblevels;
set work.actors;
if jobcode in ('Actor I', 'Actor II') then
joblevel='Beginner';
if jobcode='Actor III' then
joblevel='Advanced';
else joblevel='Unknown';
run;
Which of the following represents the possible values for the variable joblevel in the
Work.Joblevels data set?
a. Advanced and Unknown only
b. Beginner and Advanced only
c. Beginner, Advanced, and Unknown
d. ' ' (missing character value)
Answer A
Why no 'Beginner'? Please help to explain, thanks.
[此贴子已经被作者于2008-7-11 3:19:35编辑过]