add errdat tool for data file, fix bugs in errip