SAS Certified Base Programmer 123 Questions (108)
The following SAS program is submitted:
libnamesasdata 'SAS-data-library'; data set; set sasdata .chemists; if jobcode = 'Chem2' then description = 'Senior Chemist'; else description = 'Unknown'; run;
A value for the variable JOBCODE is listed below:
JOBCODE
chem2
Which one of the following values does the variable DESCRIPTION contain?
A. Chem2
B. Unknown
C. Senior Chemist
D. ‘ ‘ (missing character value)
Topics:
SAS Base Questions |
8 Comments »
B
Please explain
‘Chem2’ is not same as ‘chem2’
‘Chem2’ is a string, therefore it’s case sensitive. ‘chem2’ is not ‘Chem2’.
The data is case sensitive though the variable names and data set names are not.. Chem2 is not same as chem2
cause ‘chem2’ ^= ‘Chem2’
but there’s an mistake: libnamesasdata doesn’t work
String variables are case-sensitive. ‘Chem2’ is different from ‘chem2’ therefore the else statement is triggered.
The data set name used is ‘set’ which is a SAS keyword. Is it not an error?