Data editing > Flow control > Rejecting records
 
Rejecting records
Quick reference
To reject a record from the tables, but to include it in the rest of the edit, type:
reject [level_name]
In a levels job, include a level name to reject all data at the given level.
More information
Normally, all records are passed straight from the edit to the tabulation section regardless of whether or not they contain errors. The reject statement tells Quantum to continue editing the record but not to include it in the tables. The record is also rejected from the weighting and where split is used, it is rejected from the clean file and can be found in the dirty file.
For example, you might write:
if (c73'8') reject
if (c80'1') t5=t5+1
end
to reject records in which column 73 contains an ‘8’ from the tabulations but not from the rest of the edit. Therefore, even if c73’8’, the record is still checked for a ‘1’ in column 80 and if one is found, t5 is incremented.
Whenever a record is rejected the variable rejected_ becomes true. You can use this variable in your program to deal with rejected records in a different way to accepted records. For example, you might want to write all rejected records out in the file rejfil for later inspection and correction:
if (rejected_) write rejfil
The variables rec_rej and rec_acc count the total number of records rejected and accepted so far. You might want to check these variables and terminate the run if too many records are rejected. For an example, see Canceling the run.
If you are working with hierarchical (levels or trailer card) data, reject at a given level rejects all data at that level. Additionally, data at a level higher than that currently being edited can be rejected from tables; for example, in the edit of data at the item level, you can reject all data at person level. The syntax for this is:
reject levelname
levelname is the name of the parent level to be rejected.
When used with split, reject at any level rejects the whole record from the clean file.
For more information about levels data, see Dealing with hierarchical data.
See also
Flow control