Going back a bit then.....
What process or steps are you using to create and save the empty (no dpc reccords) .etl files?
What records (if any) are being found? Could be problem in the search criteria. Works but looking for records that do not exist and thus the file is empty.
For the most part try to accomplish each required action just as a standalone effort.
One technique is to add some extra lines of code that simply display given values, variables, filenames.
For example: display the files in the target folder where the .etl files are to be saved.
Then after the files is reportly saved by whatever code you are using - redisplay the folder again.
Is the file really there? Filename, date, size etc. as expected?
Then when each action (process) is working then combine and run in order per your requirements.
Premise being that if you know that each individual action works then any new problems are likely in the order off things or the code being used to tie it all together.