By admin | December 23, 2009

SAS Certified Adv Programmer 130 Questions (35)

The following SAS FORMAT procedure is submitted:

proc format lib = sasuser;
    value tempc 
        low < 0 = 'BELOW FREEZING'
        0<5 = 'COLD'
        5< 10= 'MILD'
        10< 15 = 'WARM' 
        15 < high = 'HOT';
run;

How is the value 10 displayed when the format TEMPC is applied?

A.10
B. MILD
C. WARM
D. BELOW FREEZING

8 comments | Add One

  1. admin - 12/23/2009 at 10:49 am

    C

  2. qiming - 01/14/2011 at 9:46 am

    I think the definition of the format is wrong due to lack ‘-‘ for the range define.

  3. csoumy - 04/18/2012 at 5:39 am

    The definition is incorrect. The correct definition should be proc format lib = sasuser;
    value tempq
    low – < 0 = 'BELOW FREEZING'
    0 – <5 = 'COLD'
    5 – < 10= 'MILD'
    10 – < 15 = 'WARM'
    15 < – high = 'HOT';
    run;

    the “less than” operator (<) is used to show a non-inclusive range (10 – <15) indicates that the 10 value is not included in the range). The Answer would be A.

  4. Polina - 08/15/2012 at 11:07 am

    Yeah, should be 10-<15 = 'WARM'

  5. Consty - 02/20/2013 at 11:55 pm

    A: because the format does not specify the case where it is then

  6. sy - 04/2/2013 at 2:03 am

    syntax error in the range specification of value :
    it should be

    proc format lib = sasuser;
    value tempc
    low-0 = ‘BELOW FREEZING’
    0<-5 = 'COLD'
    5<-10= 'MILD'
    10<-15 = 'WARM'
    15< -high = 'HOT';
    run;

    and based on this , the answer should be B

  7. r - 10/31/2013 at 2:57 pm

    proc format;
    value tempC
    low < 0 = 'BELOW FREEZING'
    0 < 5 = 'COLD'
    5 < 10 = 'MILD'
    10 < 15 = 'WARM'
    15 < High = 'HOT' ;
    run;
    data x2;
    input temp @@;
    Convtemp = put(temp,tempc.);
    datalines;
    10 10.2 9.9 10.02
    ;
    run;

    temp convtemp
    10 mild (doesn't make sense);
    On the other hand 10 is included in the WARM range; WARM may be correct, while MILD covers < 10??

  8. chinawokee - 07/9/2014 at 6:51 pm

    based on sy’s logic
    should it be C?

Leave a Comment

Leave a Reply

Your email address will not be published.