ElearnSAS.com

ElearnSAS.com
SAS Learning Platform

Base SAS 3

The contents of the raw data file AMOUNT are listed below:
--------10-------20-------30
$1,234
The following SAS program is submitted:
data test;
infile 'amount';
input @1 salary 6.;
if _error_ then description = 'Problems';
else description = 'No Problems';
run;
Which one of the following is the value of the DESCRIPTION variable?
A. Problems
B. No Problems
C. ' ' (missing character value)
D. The value can not be determined as the program fails to execute due to errors.
Click Comment link to get answer

77 comments:

  1. Anonymous12:16 AM

    The Answer will be A. as the program has an error which is compilation error so this will falg _ERROR_ to 1.

    i think the error occurs in "infile" statement.

    Any suggestions!!!!

    ReplyDelete
    Replies
    1. Anonymous4:04 AM

      THE ANSWER WILL BE A. BUT NOT DUE TO COMPILATION ERROR, IT IS DUE TO DATA ERROR.
      IN COMPILATION ERROR THE PROGRAMM STOP NOT EXECUTED. HERE THE PROGRAMM EXECUTE FULLY WITH ERROR IN LOG WINDOW.

      Delete
    2. Anonymous9:07 PM

      I agree with you Anonymous.

      Delete
    3. Anonymous5:49 PM

      Which Anonymous you agreeing with ? Every body is bloody anonymous here.

      Delete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Anonymous1:00 AM

    Its' A

    ReplyDelete
  4. yes A us answer, if we follow informat dollar8. what is value of desc variable ?

    ReplyDelete
  5. Anonymous6:32 AM

    yes A us answer, if we follow informat dollar8. what is value of desc variable ?

    ReplyDelete
  6. Anonymous10:05 PM

    Answer is A. But if use the informat COMMA6.0 in input function then it will not give any error.

    ReplyDelete
  7. The Answer is ultimately A. Problems

    Reason:
    Input statment should be like below;
    input @1 salary dollar6.;
    or
    input @1 salary comma6.;

    ReplyDelete
  8. No problem ans B

    ReplyDelete
  9. Anonymous3:52 AM

    The answer is A if your SAS environment allows variable names longer than 8 characters. If not (like mine) then the answer is D as it fails to execute.

    ReplyDelete
  10. Anonymous2:32 AM

    The Answer is "A" as the informat provided in incorrect & sas cannot read $ and , symbols by giving 6. informat.....

    so, it gives _error_ = 1
    so it will take the value to be "problem" for the description variable..

    ReplyDelete
  11. swapna1:31 PM

    the answer is A
    it is data error so the program executes and salary will have a missing numeric value which is period and description as problems

    ReplyDelete
  12. Anonymous2:31 PM

    Salary is in non-standard numeric format and hence SAS cannot read without using informat. SAS generates error and print the decription as problems in list file and sets salary as missing value.

    ReplyDelete
  13. This comment has been removed by the author.

    ReplyDelete
  14. Anonymous4:38 AM

    ans is D.....

    ReplyDelete
  15. Anonymous12:18 AM

    Answer is D ; As infile 'amout" says physical file doesnot exist

    ReplyDelete
  16. Anonymous12:08 AM

    D is the correct answer

    ReplyDelete
  17. Anonymous3:42 PM

    Its A, SAS will throw an error in compiling the statement , there is a "Problem" in the code

    ReplyDelete
  18. My friends here he ask about variable description so answer is "A"........ :)

    ReplyDelete
  19. yes ans is B coz programe is successully run. but salary is missing their not issue

    ReplyDelete
  20. Anonymous10:30 PM

    I think I agree with hayder, that the ans is B It is a data error and that won;t stop the program from executing.

    Can the admin plz comment

    ReplyDelete
  21. Anonymous6:59 PM

    correct answer is D

    ReplyDelete
  22. Anonymous8:23 AM

    Answer A:

    Incorrect informat in the input statement, salary is missing '.' during execution, the if statement executes, assigning the description text, with _error_ = 1.

    B is ruled out, for another reason - because the length of the variable description is determined in the if statement by the character string first encountered: 'Problems' during compilation, so that if _error_ = 0 a truncated 'No Probl' (8 characters) would be stored in the variable and appear in the dataset not 'No Problems'.
    (That's almost funny. :-/)

    The statement:

    length description $ 11;

    prior to the if statement is required to avoid this.

    Nigel

    ReplyDelete
  23. Anonymous5:10 PM

    I guessed D but then I tried it (SAS 9.3) and A is correct.

    ReplyDelete
  24. Anonymous6:53 PM

    the answer is C.
    The only problem is that of informat. The correct one is input @1 salary DOLLAR6.

    ReplyDelete
  25. Anonymous2:01 AM

    no its A or D..will the SAS run a program if a wrong informat is written for a variable value???

    ReplyDelete
    Replies
    1. Anonymous6:56 PM

      SAME QUESTION HERE

      Delete
  26. Anonymous2:57 PM

    I will do the exam and with this dicussion i can't understand the correct answer.
    For me the corret answer is D, but i any tried.

    ReplyDelete
  27. priyesh6:21 AM

    answer is A, i had copy paste it on sas 9.2 and gt d result error =problems means A

    ReplyDelete
  28. Krupanand9:03 AM

    A is the correct answer for sure.

    ReplyDelete
  29. VENKAT2:06 PM

    ans is A. I THINK THE PROBLEM IS IN INPUT METHOD.

    ReplyDelete
  30. Anonymous11:06 AM

    A can be the answer

    ReplyDelete
  31. /* this syntax will generate $1,234 No Problem out put; use length statement in order not to truncate No Problem; as per the error is in the salary 6 statement */

    data amount;
    input @1 salary dollar6.;
    format salary dollar6.;
    length description $12;
    if _error_ then description = 'Problems';
    else description = 'No Problems';
    datalines;
    $1,234
    ;
    run;

    ReplyDelete
  32. Anonymous9:43 PM

    Does it matter that the file is in all caps "AMOUNT" but the statement calls for infile 'amount' ?? The SAS base 9 guide says things in ' ' are usually case-sensitive...

    ReplyDelete
  33. Answer: A

    Try the below problem for extra practice:
    http://sascert3.blogspot.com/2013/03/base-sas-example-question-21.html

    Good luck!

    ReplyDelete
  34. the informat provided in the input statement is wrong.
    $1,234 should be read as a character type, so the informat should be $6. not 6. Hence there is an error.
    So value of _error_=1 there fore value of description='Problems'.

    ReplyDelete
  35. This comment has been removed by the author.

    ReplyDelete
  36. Anonymous6:31 PM

    Answer is D. The error is an execution time error which is mainly of two types- Invalid Data and Invalid Fileref. In the first case the program will compile and execute but in the latter case the program compiles but does not execute and writes out an ERROR: "Invalid Fileref".

    ReplyDelete
    Replies
    1. Yes the answer is D no execution happened so that no any value will be assigned to description.

      Delete
  37. Anonymous5:37 AM

    yep, I agree it should be D. There is no path mentioned in 'infile' statement or does it refer to work.amount where amount refers to work.amount?

    ReplyDelete
  38. This comment has been removed by the author.

    ReplyDelete
  39. Here is the output from sas 9.4:

    Obs salary description
    1 4 No probl

    ReplyDelete
  40. For latest and updated SAS certification dumps in PDF format. contact us at completeexamcollection@gmail.com.
    Refer our blog for more details: http://completeexamcollection.blogspot.in/2015/12/sas-certification-dumps.html

    ReplyDelete
  41. welcome to glub casino for play games online !
    gclub
    gclub casino online

    ReplyDelete
  42. It's interesting that many of the bloggers to helped clarify a few things for me as well as giving.Most of ideas can be nice content.The people to give them a good shake to get your point and across the command.
    Tableau Online Training|
    SAS Online Training
    R Programming Online Training|

    ReplyDelete
  43. This comment has been removed by the author.

    ReplyDelete
  44. those who are interested to learning the sas program this very helpful..learn the sas program to achieve economical benchmark.SAS Training in Chennai

    ReplyDelete
  45. Can anyone please explain use of below line in this question

    ——–10——-20——-30

    ReplyDelete
  46. Those guidelines additionally worked to become a good way to recognize that other people online have identical fervor like mine to grasp a great deal more around this condition. and I could assume you are an expert on this subject. Same as your blog i found another one Amazon Master Class .Actually I was looking for the same information on internet for Amazon Master Class and came across your blog. I am impressed by the information that you have on this blog. Thanks a million and please keep up the gratifying work.

    ReplyDelete
  47. Serial key for VRay Next 5.10.05 for SketchUp 2017-2021 can be found and viewed here. We have the largest serial numbers data base.
    Related searches VRay Crack

    ReplyDelete
  48. pg slot 6g มาแรง ที่สุด ในตอนนี้ เป็นเรื่องที่น่าสนใจอย่างมากในวงการเกม PG สล็อตออนไลน์ในปัจจุบัน ซึ่งมีการพัฒนาและนวัตกรรมที่ทันสมัยเข้ามาเพื่อให้ผู้เล่นได้สัมผัสประสบการณ์การเล่นที่ยิ่งใหญ่และเพลิดเพลินไปกับความตื่นเต้น

    ReplyDelete