DATA_WRITER creating empty files

I have a very simple graph that contains a decision point, and depending on this decision the data comes out of either port 0 or port 1. Connected to these ports are DATA_WRITER components that will write either a success of fail file. The problem I am having is that if the decision point sends data to the success DATA_WRITER, then even though no records are sent to the fail DATA_WRITER a empty file is still written to the file system (or vice versa). Is there any way to stop the data writer from creating a file when no data is sent to it?

Hello Joe,
if the file name is determined, it is always created. So the only one way, to not create an empty file, is to use partition feature of DataWriter (if you don’t partition the records in fact, it doesn’t matter, which field you set as partitionKey). But then “something” will be added to your not-empty output file name. If you set partitionKey only, the 0 (zero) is added to the file name specified in the fileURL attribute. If you use # character in the file url, it is replaced by the number or key field value (if partitionFileTag=“keyNameFileTag”). To create file with your original name, you have to create a Simple Lookup Table, where in the key field you have the same value as in input record and the field you select as partitionOutFields there contains output file name.