Data editing > Flow control > Canceling the run
 
Canceling the run
Quick reference
To cancel a run, type:
cancel [num_times_execute]
More information
cancel, which is similar in format to stop, terminates the run immediately, producing tables only for those respondents already passed to the tabulation section. It is often used to halt a run when too many errors have been detected in the data. For example, to cancel the run when more than 100 errors have been found, you might have:
/* ect is the error counter
if (c110n'1') write $error in c110$; ect=ect+1
if (c145n' ') write $c145 not blank$; ect=ect+1
if (ect.gt.100) cancel
To cancel the run when more than 50 records have been rejected, write:
if (rec_rej.gt.50) cancel
Alternatively, cancel can be followed by a number indicating that the run should be cancelled when the statement has been executed a specific number of times:
cancel 100
cancels the run when this statement has been executed 100 times.
As with stop, holecounts and error listings will only contain information about records read prior to the cancellation condition being fulfilled. If 400 records are read before 101 errors are found, you will see the errors for those 400 records.
See also
Flow control