def validate(value, row):
    if not value:
        if halt_on_error:
            raise DataError('Missing RECTYPE in data sentence_id: %' % row['id'])
        else:
            log.write('rectype', [row['id'], row['rapstatex'], '', 'Missing RECTYPE in data.'])
            return 9
    elif value != '3':
        #pass RuleError
        if halt_on_error:
            raise DataError('Wrong value for sentence RECTYPE (3), value = %s on sentence_id: %s' % (value, row['id']))
        else:
            log.write('rectype', [row['id'], row['rapstatex'], value, "Wrong value for sentence RECTYPE (3)."])
            
    return value