Error Handling: Center of Excellence Data Warehousing
Error Handling: Center of Excellence Data Warehousing
Center of Excellence
Data Warehousing
Error Handling
semantic the language element is correct, but the element may compile time
not be valid for a particular usage
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:
Example:
writes the name of the variable followed by an equal sign and the
value.
Example:
put Var=;
Example:
If the value of the variable ChVar is THIS with a leading space, the
statement
PUT
PUT_ALL_;
_ALL_;
writes the name of each variable in the PDV followed by an equal sign
and the value of the variable.
Error Handling
DATA
DATAdata-set-name
data-set-name // DEBUG;
DEBUG;
Error Handling
DEBUG Commands
Common commands used with the DEBUG option.
Command Abbreviation Action
STEP ENTER key Steps through a program
one statement at a time.
EXAMINE E variable(s) Displays the value of the
variable.
WATCH W variable(s) Suspends execution when
the value of the variable
changes.
LIST WATCH L W List variables that are
watched.
QUIT Q Halts execution of the DATA
step.
Questions