ArchiveDAT .dat files only stores the final value.
You will need to calculate the value on your program, then write the value to the file.
I usually write a script to convert my legacy data from other system to a excel with 2 sheets, (x axis for cnl no., y axis for datetime), 1 table for value, 1 table for stat. Then I write formulas in excel to calculate the data, and modify data manually if needed.
Then run another program to convert excel to scada .dat file.