As long as the $new_name variable does not change with every transaction, if you check “Append data” in the file protocol Outbound Properties, it should work.
I concur. I use things like the date from MSH.7 without the time as part of the filenaming. By virtue of the date changing from the MSH.7 value, I get daily batches….that I can reproduce. And yes check append.
I had that checked in the properties. However it still seems to be recreating the file. I need a new file everyday and am naming on the date. I’ve added the OBAPPEND as suggested to see if this will work.
set systemTime [clock seconds]
set datetimestring [clock format $systemTime -format %Y%m%d]
I have had better luck doing things like this using the upoc protocol in both the read and write mode with a timer. Set the timer in the read mode to when name should change. Simply add to the file in write mode using the append mode with the file command.
In the read mode, when triggered you could rename the file and even move completed file to another location.