I’ve a requirement to decide output file names dynamically like file name appended by current date-time. Is this possible with UniversalDataWriter? I went through a couple of related posts in the forum, but they were a little unclear to me.
This goal can be achieved very easily using parameters.
1. Create new parameter TODAY with value `date2str(today(),“yyyy-MM-dd”)` (Note that I have used back quotes syntax allowing me to use CTL1 functions within parameters.)
2. Set File URL in UniversalDataWriter to ${DATAOUT_DIR}/output-${TODAY}.txt
3. The result file is in data-out directory and it is named output-2014-02-06.txt
Hi,
I also would like to use the some solution, but wanted to have different date (ex: today+1 or today-1), I tried by using others date function to apply in your solution with value `date2str(dateAdd(today(),1,day),“yyyyMMdd”)` but failed, any suggestion?
Please note that CTL1 has to be used in parameters. And in CTL1, the name of dateadd function is defined with lower case “a” as opposed to CTL2 where dateAdd is defined with upper case “A”. Change this one character and your expression should be ok.