Data editing > Data validation > Column and code validation > Comments with require
 
Comments with require
Quick reference
To define a message to be printed when a record fails a test, type:
r [/err_code/ ] condition columns $message$
More information
When incorrect records are printed out, require automatically prints a short text describing the error. Normally, it tells you what codes were found in the column which is wrong, but if this is not what you want, you can define your own error text by entering it enclosed in dollar signs at the end of the statement. This text will then be printed in place of the default text when errors are found. For example, if c329 is multicoded when it should be single-coded, the statement:
r sp c329
prints the whole record and shows which codes were found in that multicode:
Column 329 is 13
Instead of being told which codes the column contains, you might prefer to see a message linking the error to a question on the questionnaire. In this case, add your own error text as follows:
r sp c329 $q21a not sp$
These texts can be as long or short as you like.
See also
Column and code validation