You successfully loaded the option chain to memory.

But then you tried to save dataset #1 to file. Dataset #1 doesn't exist. The problem is that the option chain is not a dataset.

Side note: Your attempt to define a string for the t8 file makes no sense. wdate() returns double, but your string format demands an int.

What exactly were you hoping the t8 file would contain? FYI, the contract chain does not contain historical data.