Debugging and Testing DATA Steps |
Testing Your
Programs![]() ![]() |
Automatic Variables
You can use a PUT statement to specify the values of the automatic
variables put 'MY NOTE: invalid value: ' code= _n_= _error_=; |
You can also use a PUT statement to specify that all variable names
and variable values, including automatic variables, be written to the
log by using the _ALL_ specification:
put 'MY NOTE: invalid value: ' _all_ ; |
Conditional Processing
You can use a PUT statement with conditional processing to flag program errors
or data that is out of range. In the example below, the PUT statement is
used to flag any missing or zero values for the variable data finance.newcalc; set finance.loans; if rate>0 then Interest=amount*(rate/12); else put 'DATA ERROR ' rate= _n_=; run; |
|
![]() ![]() ![]() ![]() ![]() ![]() |
|
![]() |
![]() |
Copyright © 2002 SAS Institute Inc.,
Cary, NC, USA. All rights reserved.