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
Answer is B.
ReplyDeleteExplanation:
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).
Answer is B
ReplyDeleteAnswer 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.
ReplyDeleteJust 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
Answer B
ReplyDeleteB
ReplyDeleteB is the answer.
ReplyDeletethe answer is D.as it can be used in datastep.
ReplyDeleteThe 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
ReplyDeleteIt depends upon the error.
ReplyDeleteIf 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.
it specifically ask for data error not syntax or merge issue.
ReplyDeleteans 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.
ReplyDeletewhen 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.
ReplyDeleteData 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:
ReplyDeletewrites 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
Answer: B
ReplyDeleteCheck 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!
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.
ReplyDeletevery true, it is Syntax errors (when program is not in the language of SAS) which causes SAS to stop execution
ReplyDeletethankyou all
ReplyDeleteyour answers are very helpful
Thanks again for the words of encouragement; even if they were meant as a tongue lashing for someone else.
ReplyDeletegclub
gclub casino online
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.
ReplyDeleteR Programming Online Training|
SAS Online Training
Tableau Online Training|
thank for the good topic,Thanks for your sharing.
ReplyDeleteดูหนังออนไลน์
B
ReplyDeleteVery 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
ReplyDeleteB
ReplyDeleteB
ReplyDeleteToo good article,Thank you for sharing it,,,
ReplyDeletekeep updating...
MSBI Online Course
ReplyDeleteen sexi memeli sürtük blowjob çekme oral sikis gizli çekim porno yerli yapancı sexs videosu, 1080p 720p sex izle