def convert(value, row):
    val = row['corix']
    missing = '999999999'
    
    if not val:
        return missing
    
    else:
        if len(val) > 9:
            log.write('cori', [row['id'], row['rapstatex'], val, "truncating data"])
            return val[:9]
        return val