Many of us are familiar with Errors in SAS and most of the time we have seen the classification of errors in SAS log .
As per the log classification in SAS, There are four type of errors in SAS :
1. SYNTAX ERROR
2. EXECUTION TIMEERROR
3. DATA ERROR
4. SEMANTIC ERROR
2. EXECUTION TIMEERROR
4. SEMANTIC ERROR
1. SYNTAX ERROR : We can have such types of errors whenever our programming statements or codes does not follow the SAS language coding rules. SAS detects SYNTAX Error at COMPILE TIME / STAGE. Syntax errors could be due to the following reasons :
- Any keyword which is not spelled correctly (Misspelled keyword)
- Missing or Invalid punctuation
- Invalid statements or data set options
2. EXECUTION TIME ERROR
- Any mathematical operation which is not legal
division by zero( ) - Any argument to
which is not legalfunction - For BY group processing, when
are not in proper orderobservations - While referring to a member of an array which does not exist
- Open and close error (for brackets and inverted commas) on SAS data sets and other files like INFILE
- Any INPUT statements which do not match with the cards /
datalines eg : Here we are trying division 80000/0 division by zero( )
3. DATA ERROR : We can have such type of errors in SAS, whenever any data values are not as per the SAS statement which we have specified in our SAS program. Suppose we have defined a variable as a numeric but we are passing some data values which are character then SAS gives an error that would be known as DATA ERROR. Data errors occurs during the program execution but these errors allow the program to continue the execution of data and does the following things:
- It prints the
under the rule lineobs - In the SAS log, It writes an invalid data notes with line number
- It sets the automatic variable _ERROR_ to for current observation
- In SAS log, it prints the input line and column number which contain invalid data
eg : Here we entered the text value innumaric field
4. SEMANTIC ERRORS : We can have such type of error in SAS, whenever our programming statements or codes are up to the mark means any SAS statement is correct but any element is not valid for that specific usage. SAS detects SEMANTIC ERRORS at COMPILE TIME / STAGE. Whenever SAS finds any semantic error in program SAS goes for syntax check mode . Semantic errors could be due to the following reasons :
- Defining or using a numeric variable where only a character variable is applicable
- For Array, when we use any illegal reference for it
- Whenever we do not specify
of arguments for any SAS Functionscorrect number