SAS Certified Base Programmer 50 Questions (29)
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)
Topics:
SAS Base Questions |
4 Comments »
A
WHY THE ANSWER IS NOT C ?
becoz the code doesn’t have if, else, else.. It has an If statement, that ends and another if statement starts, with else. At each statement the variable that gets updated in joblevel
I am confused about this answer. Please clear it as soon as possible.