ElearnSAS.com

ElearnSAS.com
SAS Learning Platform

Base SAS 17

The following SAS program is submitted:
libname sasdata 'SAS-data-library';
data test;
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)
Click Comment link to get answer

19 comments:

  1. is it because of the case of the string chem2 instead of Chem2 that the answer is B?

    ReplyDelete
  2. Anonymous9:47 AM

    yes it is cause of the case of the string. Answer is B

    ReplyDelete
  3. Anonymous9:15 AM

    answer B

    ReplyDelete
  4. Anonymous8:47 PM

    Answer is D. The letter 'C' of 'chem2' is different

    ReplyDelete
  5. Answer is D. The letter 'C' of 'chem2' is different

    ReplyDelete
  6. ans is B. thats aall because of c..

    ReplyDelete
  7. Anonymous6:22 PM

    B is the answer because value of Jobcode="chem2" different of test value of Jobcode="Chem2" so THEN statement will be skiped and ELSE statment will be executed
    By USK16000

    ReplyDelete
  8. Anonymous6:39 PM

    B is the answer because the case of the string chem2 differs to Chem2

    ReplyDelete
  9. Answer B.
    If is case sensitive and considers if jobcode = 'Chem2' as false. 'unknown is the answer.

    ReplyDelete
  10. Anonymous7:08 AM

    Ans is B. reason is , Chem2 is in inverted comma. if any word is in inverted comma than sas will be case sensitive for that word.

    ReplyDelete
  11. Anonymous10:34 PM

    My code

    DATA CHEMISTS;
    JOBCODE = 'chem2';
    RUN;

    DATA TEST ;
    SET CHEMISTS;
    IF JOBCODE = 'Chem2' then desc = 'Senior Chemist';
    else desc = 'Unknown' ;
    RUN;

    PROC PRINT DATA=TEST; RUN;


    Obs JOBCODE desc

    1 chem2 Unknown

    ReplyDelete
  12. answer is d because values within the quotation mark is case sensitive i.e. chem2 not equal to Chem2 ..

    ReplyDelete
    Replies
    1. Anonymous8:13 PM

      That's why answer is B

      Delete
  13. Anonymous10:52 PM


    Your blog is very useful for me.I really like you post.Thanks for sharing.

    gclub online
    goldenslot

    ReplyDelete
  14. Anonymous5:54 PM

    Answer is D as words enclosed in the quotation mark are case-sensitive. Here "C" is different in both Chem2.

    ReplyDelete