Automatic coding of occupation and cause-of-death records