Base SAS 1

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_service / 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)
Click Comment link to get answer

59 comments:

  1. The Answer will be D as amount will be 0 and the per_year should be calculated only if amount ne 0. Asuming the variable name are valid.

    ReplyDelete
  2. i agree...the answer is 0.

    ReplyDelete
  3. Answer is zero, but in Version 9 & above the variable length is not a problem, it can be more than 8 chars.

    ReplyDelete
  4. Answer is D (missing)
    Naming of the variable doesn't impose any restriction it can be more than 8

    ReplyDelete
  5. The variable name can be upto 32 chars long.

    ReplyDelete
  6. Maximum Length of User-Supplied SAS Names SAS Language Element Maximum Length
    Arrays 32
    CALL routines 16
    Catalog entries 32
    DATA step statement labels 32
    DATA step variable labels 256
    DATA step variables 32
    DATA step windows 32
    Engines 8
    Filerefs 8
    Formats, character 31
    Formats, numeric 32
    Functions 16
    Generation data sets 28
    Informats, character 30
    Informats, numeric 31
    Librefs 8
    Macro variables 32
    Macro windows 32
    Macros 32
    Members of SAS data libraries (SAS data sets, views, catalogs, indexes) except for generation data sets 32
    Passwords 8
    Procedure names (first 8 characters must be unique, and may not begin with "SAS") 16
    SCL variables 32

    Variable name is not a problem,
    1. Since division by zero, Mathematical operations could not be performed
    2. The results of the operations have been set to missing values.

    ReplyDelete
  7. years_service can take the value of 1 as it says if 2 le years_service le 10. Due to which amount gets a value of 1000 and the correct answer should be 0.001

    ReplyDelete
  8. Answer is D because anything divided with 0 is infinite in answer it is not given hence answer is missing

    ReplyDelete
  9. Answer is D as Infinite will not be given

    ReplyDelete
  10. The answer is D

    ReplyDelete
  11. what's the correct answer

    ReplyDelete
  12. The answer is D

    ReplyDelete
  13. The answer is D. Missing Value.
    SAS Log:
    NOTE: Mathematical operations could not be performed at the following places. The results of the operations have been set to missing values.
    S.D.

    ReplyDelete
  14. Answer id D

    - Hema Kolte

    ReplyDelete
  15. Correct Answer is D becoz 1000/0 is not defined so missing value will come

    ReplyDelete
  16. My Answersheet says this;
    C. 2000
    D. (missing numeric value)
    Answer: C

    What is the logic to choose C?

    I followed the answer D many times, and can not agree with C.

    Sakar Sham

    ReplyDelete
  17. Exam Advise.

    Folks:If had answered 2 more correct I would have passed.
    Panicked as I took too much time and little nervous too.

    only 20 percent questions were similar to these.
    Some are harder .I will sit on August 2nd week again.

    ReplyDelete
  18. Some more tips for EXAM:

    Go online and try to find more questions or demos, I found 3 questions that was easy to answer as I lapse the time, did not answer them correctly. If you find any virtual exam free try those.

    THOSE WHO GETS ANSWER JUST TESTING ON SAS PROGRAM WILL NOT PASS,
    NEED YOUR BASIC SKILL AND LOGIC & CHOOSE THE RIGHT ONE. IF THE SAME QUESTION BUT ASKED LITTLE DIFFERENTLY YOU NEED TO KNOW HOW TO FIND THE SOLUTION.

    ReplyDelete
  19. CHECK THIS:

    this web site lets you do virtual exam.
    Exactly the same as this one.

    http://www.esnips.com/doc/17138a3d-ddc9-4708-b3ab-4e24c7259590/A00-201

    FOlks SHARE information on this Page.

    ReplyDelete
  20. i wrote exam it was too tough it includes not only these things and more abt csv. excel files importing printing and some more. if i get one correct ans now i might be certified pgrmr but i got 64%. bcz of qns on csv excel etc...

    ReplyDelete
  21. Too bad pal, I got only 59 and sitting on sep 2nd week.
    Some questions are too long and in two different pages makes harder.

    If you can not answer the question, mark it and move to another question. At the end you can redo it. If you can not manage time, you may panic. I have exam phobia so need more time management and concentration, using logic if not sure is the best way to be close to get passed.

    ReplyDelete
  22. Pal I am busted too,
    This is not a fair exam Exactly the same shit happened to me .

    How to Co-relette with ODS.Html file and
    office2k, excel, winxp and something.
    CSV- 3 question
    date , mohth and years separately numeric or character?
    3 excel import and lib file.
    did we do that.

    Man can not sit more than 3 times , it is 2nd.

    It should be from all the chapters?

    Too tough and could not relate. Some as we study but no logic to relate with the answer they have.

    bairagi.kailo@yahoo.com

    ReplyDelete
  23. Folks:

    Let me give you an example, there may be distraction and you focusing on it than the content.
    Example: if it was asking the sas lib but giving you the excel file and the sheet name.

    Choose the one which can be used as sas library and that can be relate to excel file. Again when you trying to relate with the excel file but sas lib reference itself is not correct, in that case do not try to relate with the excel program, choose the which can be the sas lib ref.

    ReplyDelete
  24. missing value I tried it on SAS 9.2... answer D
    no doubt!

    ReplyDelete
  25. Replies
    1. i am appearing for the exam? does similar kind of Q's will be there in exam? or totally diff....

      Delete
  26. In addition:
    Of course it is hard to tell the exact percentage of the questions from my exam that were similar to the ones on this website. Let's say that at least 20% of the questions were VERY similar and that I felt myself helped by this website (and the one of Support SAS with 10 sample questions) in more than half of the cases. Once again, for me it was really worth the effort solving all the questions on this site.

    ReplyDelete