By admin | October 13, 2009

SAS Certified Base Programmer 123 Questions (123)

The following SAS program is submitted:

data test;
    set sasuser.employees;
    if 2 le years_service le 10 then
        amount=1000;
    else if years_service gt 10 then
        amount=2000;
    else
        amount=0;
    amount_per_year=years_serice/amount;
run;

Which one of the following values does the variable AMOUNT_PER_YEAR contain if an employee has been with the company for one year?

A. 0
B. 1000
C. 2000
D. . (missing numeric value)

17 comments | Add One

  1. admin - 10/13/2009 at 2:02 pm

    D

  2. Reena Pandit - 06/3/2010 at 2:19 am

    Please provide the questions along with the answers for base SAS

  3. admin - 06/25/2010 at 7:22 am

    the 1st comment is the correct answer.

  4. David - 06/29/2010 at 10:27 pm

    D is right. the output of running the program is:
    years_ amount_ years_
    Obs service amount per_year serice

    1 1 0 . .

  5. sarabjeet - 08/19/2011 at 1:53 pm

    What does this if condition means

    if 2 le years_service le 10 then

  6. vignesh kumar - 12/21/2011 at 1:34 am

    It is nice for SAS certifications.

  7. abha - 01/11/2012 at 3:34 pm

    D is correct answer.

  8. oscar - 07/4/2012 at 8:08 pm

    any number divided by 0 is undefined. so i guess the answer is D

  9. Renu - 10/23/2012 at 1:09 pm

    D is supposed to be the correct answer but there is a typo in the question amount_per_year=years_serice/amount;
    “years_serice” r is missing in service

  10. Arthur - 11/6/2012 at 1:40 pm

    The correct answer is:

    Numeric Missing Value, because
    is impossiblie the division by 0.
    Its an indefined number.

  11. Arthur - 11/6/2012 at 1:42 pm

    I share this code for test de true answer:

    data probando;
    infile datalines dsd;
    input Years_service;
    datalines;
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    45
    ;
    run;

    proc print data=probando;
    run;

    *NOW THE IMPORTANT CODE;

    data prueba;
    set work.probando;
    if 2 le years_service le 10 then
    amount=1000;
    else if years_service gt 10 then
    amount=2000;
    else
    amount=0;
    amount_per_year=years_service/amount;
    run;

    proc print data=prueba;
    run;

  12. Raju - 12/13/2012 at 6:28 am

    D is the correct answer . If you divide any value with 0 the final result will be .( missing value )

  13. ankita - 12/18/2012 at 5:44 am

    the correct answer is D.
    thre is typo in the prog :

    data test;
    set sasuser.employees;
    if 2 le years_service le 10 then
    amount=1000;
    else if years_service gt 10 then
    amount=2000;
    else
    amount=0;
    amount_per_year=years_service/amount;
    run;

  14. suvarna - 01/28/2013 at 2:39 pm

    D is right.

  15. Mohan - 02/22/2013 at 10:20 pm

    D is the correct answer

  16. Prabhakar - 04/3/2014 at 4:29 am

    Above condition satisfies the last else statement,
    else
    amount=0;
    amount_per_year=years_serice/amount;
    so amount_per_year=1/0;
    Answer will be(.) which is missing value.
    Answer D is correct.

  17. DeepthySajay - 12/24/2014 at 2:56 am

    D is the answer. Division by o returns a missing value

Leave a Comment

Leave a Reply

Your email address will not be published.