Nora,
The key will be capturing the original file name in the first place. Are you using fileset local to read the file? FTP? Did you write a file reader procedure of your own?
Once you have the file name then you will want to stash the file name in the driver control metadata field so that it travels along with the message until the end and the driver will then use that file name to write it out.
FYI, you can’t save the file name in a global variable because each thread has it’s own namespace and Cloverleaf doesn’t publish the namespace names anywhere.
Let me know how you’re reading the file and either me or someone else can tell you how to capture the file name.
Cheers,