Data editing > Flow control > Stopping the processing of data by the edit
 
Stopping the processing of data by the edit
Quick reference
To stop editing records and start tabulating records read so far, type:
stop [num_times_execute]
More information
stop tells Quantum to stop the run and print tables once editing has been completed on the current record. For example, to test tables for 50 people who own goldfish, set up a counter and terminate the run when it reaches 50:
/* gfish counts those owning goldfish
if (c113'5') gfish=gfish+1
if (gfish.gt.49) stop
If you do not want to restrict ourselves to goldfish owners, and are satisfied with just the first 100 respondents, use the reserved variable rec_count, and stop when it reached 100:
if (rec_count.eq.100) stop
Alternatively, to be sure that the run stops when 100 records have been accepted for tabulation, write:
if (rec_acc.eq.100) stop
When the stop statement is executed, the reserved variable stopped_ becomes true.
A variation of stop is
stop n
n is the number of times the statement is to be executed. If stop is part of a routing pattern in the edit, it might be necessary to read in more than the n records to execute the statement n times. For example, here is another way of counting goldfish owners:
/* only deal with goldfish owners
if (c113n'5') goto 20
- - other statements - -
stop 50
/* everyone comes here
20 continue
Here, the stop statement is only executed whenever Quantum find someone who owns a goldfish. It might need to read data for 72 respondents before it reaches the target of 50 goldfish owners.
When either form of stop is used, editing and tabulation is completed for the respondent at which the condition is fulfilled, and no more records are read. Therefore, if you have to process 72 respondents in order to find 50 goldfish owners, a holecount requested by the edit would include 72 records and errors in those 72 records would be included in the error listings. For more information about creating holecounts, see Holecounts.
See also
Flow control