rename dat to generate_date, tsgs table.