By admin | October 6, 2009

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)

8 comments | Add One

  1. admin - 10/6/2009 at 3:18 pm

    B

  2. ritter_james - 08/31/2012 at 7:20 am

    Please explain

  3. PS - 08/20/2013 at 11:02 am

    ‘Chem2’ is not same as ‘chem2’

  4. Josie - 02/6/2014 at 1:48 am

    ‘Chem2’ is a string, therefore it’s case sensitive. ‘chem2’ is not ‘Chem2’.

  5. su - 04/12/2014 at 4:50 pm

    The data is case sensitive though the variable names and data set names are not.. Chem2 is not same as chem2

  6. benwed - 07/24/2014 at 4:41 am

    cause ‘chem2’ ^= ‘Chem2’

    but there’s an mistake: libnamesasdata doesn’t work

  7. Erik - 09/22/2014 at 7:17 pm

    String variables are case-sensitive. ‘Chem2’ is different from ‘chem2’ therefore the else statement is triggered.

  8. Kaustubh - 01/28/2015 at 2:19 pm

    The data set name used is ‘set’ which is a SAS keyword. Is it not an error?

Leave a Comment

Leave a Reply

Your email address will not be published.