Convert clearstatus macro in function.