ElearnSAS.com

ElearnSAS.com
SAS Learning Platform

Base SAS 7

Which one of the following is true when SAS encounters a data error in a DATA step?
A. The DATA step stops executing at the point of the error, and no SAS data set is created.
B. A note is written to the SAS log explaining the error, and the DATA step continues to execute.
C. A note appears in the SAS log that the incorrect data record was saved to a separate SAS file for further examination.
D. The DATA step stops executing at the point of the error, and the resulting DATA set contains observations up to that point.
Click Comment link to get answer

26 comments:

  1. Anonymous11:44 AM

    Answer is B.
    Explanation:

    Notice what happens when SAS encounters invalid data.
    1 An error message is printed on the log.

    NOTE: Invalid data for DOB in line 6 9-15.
    2 The raw data line is printed with a ruler.

    RULE:----+----1----+----2----+----3----+----4----+----5----+----6
    6 1 SMITH 1/23/66 68 144 M 26
    Aside: Notice how the error message "for DOB in line 6 9-15" points you to the variable being read, the line number and the column range where the input error occurred.

    3 The resulting values of all the variables (after the input process) are printed.

    ID=1 LASTNAME=SMITH DOB=. HEIGHT=68 WEIGHT=144 GENDER=M AGE=26 _ERROR_=1 _N_=1
    Aside: The special variables _ERROR_ and _N_ are used in the data set
    to indicate whether a run-time error has occurred with this observation, and
    to indicate how many times the data step has executed.
    These two variables are not included in the output dataset.

    4 The data step keeps running.

    NOTE: The data set WORK.WONTWORK has 4 observations and 7 variables.
    Also see that the Proc Print output shows that a dataset with values was created. All the variables have been given values for all the observations (a missing value is a value).

    ReplyDelete
  2. Answer is B. In the below example though the program encountered a problem with the 3rd observation but still the data step continued to process till the end.

    Just observe the below sas program and its output.

    data temp;
    input name $ no;
    datalines;
    AppaRao 10
    subbarao 20
    12 papa rao 30
    Kiran 25
    ;
    run;
    proc print data=temp;
    run;

    Log Window Output:
    54 data temp;
    55 input name $ no;
    56 datalines;

    NOTE: Invalid data for no in line 59 4-7.
    RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+--
    59 12 papa rao 30
    name=12 no=. _ERROR_=1 _N_=3
    NOTE: The data set WORK.TEMP has 4 observations and 2 variables.
    NOTE: DATA statement used (Total process time):
    real time 0.00 seconds
    cpu time 0.00 seconds


    61 ;
    62 run;
    63 proc print data=temp;
    64 run;

    NOTE: There were 4 observations read from the data set WORK.TEMP.
    NOTE: PROCEDURE PRINT used (Total process time):
    real time 0.01 seconds
    cpu time 0.01 seconds

    ReplyDelete
  3. Anonymous2:34 PM

    the answer is D.as it can be used in datastep.

    ReplyDelete
  4. swapna2:24 PM

    The answer is B. data errors occur in data step but it is a execution time error, so it continues to execute. Most of the syntax errors that occur during the compilation phase stop the execution of sas program

    ReplyDelete
  5. Anonymous1:22 PM

    It depends upon the error.
    If it's a syntax error then the A occurs.
    If it's an error with invalid data then B will occur .
    If it's a problem with merging two or more datasets, then D will occur.

    ReplyDelete
  6. Anonymous1:34 PM

    it specifically ask for data error not syntax or merge issue.

    ReplyDelete
  7. aniket4:40 AM

    ans is B , it becos when ther is data error it will disply as _error_ =1 and it will exicute wher Ques was only error then it would had been A. thats becose when ther is error in statment it will display in red and for such output is not exicuted.

    ReplyDelete
  8. Anonymous11:29 AM

    when SAS encounters syntax errors then it gives a note in the SAS log saying: The SAS system stopped processing this step because of errors. and when SAS encounters data errors a note is written to the SAS log explaining the error, and the DATA step continues to execute. So Ans is B.

    ReplyDelete
  9. Anonymous7:47 AM

    Data errors occur when some data values are not appropriate for the SAS statements that you have specified in the program. For example, if you define a variable as numeric, but the data value is actually character, SAS generates a data error. SAS detects data errors during program execution and continues to execute the program, and does the following:
    writes an invalid data note to the SAS log.
    prints the input line and column numbers that contain the invalid value in the SAS log. Unprintable characters appear in hexadecimal. To help determine column numbers, SAS prints a rule line above the input line.
    prints the observation under the rule line.
    sets the automatic variable _ERROR_ to 1 for the current observation.

    From SAS documentation
    And the answer is B

    ReplyDelete
  10. Answer: B

    Check out my most recent post on passing the Base SAS exam at the link below - these tips will definitely help you ace the test!

    http://sascert3.blogspot.com/2013/03/becoming-base-sas-certified-tip-1.html

    Good luck!

    ReplyDelete
  11. Anonymous6:57 PM

    Invalid data errors cause SAS to write a NOTE to the log indicating explaining the error and printing out the data line with errors. Invalid data errors do not stop the processing of programs. The program compiles and executes.

    ReplyDelete
  12. very true, it is Syntax errors (when program is not in the language of SAS) which causes SAS to stop execution

    ReplyDelete
  13. thankyou all
    your answers are very helpful

    ReplyDelete
  14. Thanks again for the words of encouragement; even if they were meant as a tongue lashing for someone else.
    gclub
    gclub casino online

    ReplyDelete
  15. This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to development very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.
    R Programming Online Training|
    SAS Online Training
    Tableau Online Training|

    ReplyDelete
  16. thank for the good topic,Thanks for your sharing.

    ดูหนังออนไลน์

    ReplyDelete
  17. Very Impressive SAS Programming tutorial. The content seems to be pretty exhaustive and excellent and will definitely help in learning SAS Programming. I'm also a learner taken up SAS Programming and I think your content has cleared some concepts of mine. While browsing for SAS Programming tutorials on YouTube i found this fantastic video on SAS Programming Tutorial. Do check it out if you are interested to know more.:-https://www.youtube.com/watch?v=4PtMFE4IjLg

    ReplyDelete
  18. Too good article,Thank you for sharing it,,,
    keep updating...

    MSBI Online Course

    ReplyDelete

  19. en sexi memeli sürtük blowjob çekme oral sikis gizli çekim porno yerli yapancı sexs videosu, 1080p 720p sex izle

    ReplyDelete