SAS Base Programming for SAS 9 — Question 28
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?
Answer options
- A. FA
- B. FA1
- C. FA 1
- D. ' ' (missing character value)
Correct answer: A
Explanation
The variable JOBCATEGORY is initially set to 'FA' and then assigned a new value by concatenating JOBCATEGORY and JobLevel. However, since the statement 'JobCategory = JobCategory || JobLevel;' is not executed due to the variable being overwritten before it occurs, JOBCATEGORY retains its original value of 'FA'. The other options are incorrect as they either introduce a concatenation or represent a missing value.