checkdata function

Check that the data supplied to ds is correct