Create and write the dataset.