Debugging is the process of removing logic errors from
a program. Unlike syntax errors, logic errors do not stop a program
from running. Instead, they cause the program to produce unexpected
results. For example, if you create a DATA step that keeps track of
inventory, and your program shows that you are out of stock but your
warehouse is full, you have a logic error in your program.
To debug a DATA step,
you could do any of the following tasks:
-
copy a few lines of the step into
another DATA step, execute it, and print the results of those statements.
-
insert PUT statements at selected
places in the DATA step, submit the step, and examine the values that
are displayed in the SAS log.
-
use the DATA step debugger.
While the SAS log can
help you identify data errors, the DATA step debugger offers you an
easier, interactive way to identify logic errors, and sometimes data
errors, in DATA steps.