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