The following SAS program is submitted:
libname sasdata 'SAS-data-library';
data test;
set sasdata.chemists;
if jobcode = 'chem3' then description = 'Senior Chemist';
else description = 'Unknown';
run;
data test;
set sasdata.chemists;
if jobcode = 'chem3' then description = 'Senior Chemist';
else description = 'Unknown';
run;
A value for the variable JOBCODE is listed below:
JOBCODE
CHEM3
JOBCODE
CHEM3
Which one of the following values does the variable DESCRIPTION contain?
A. chem3
B. Unknown
C. Senior Chemist
D. ' ' (missing character value)
B. Unknown
C. Senior Chemist
D. ' ' (missing character value)
5 comments:
Answer: B
The dataset has ‘CHEM3’ and the if statement is looking for ‘chem3’…
Remember the SAS variables are not case-sensitive but the SAS DATA is…
B
Answer C.
try this
data ch;
input jcode $;
cards;
chem3
;
data ch1;
set ch;
if jcode = 'chem3' then description = 'Senior Chemist';
else description = 'Unknown';
run;
proc print data=ch1;
run;
Sridhar your answer clearly does not make sense. As SASGuru said SAS variables are not case sensitive but the Data is. So if you are searching for variable chem3 however the data is actually CHEM3 then you are not going to match. The result will be Unknown. The correct answer is B
I DIDN'T GET IT
Post a Comment