Using dynamic file names in UniversalDataWriter

Support/help with CloverETL (4.9) and CloverDX (5.0 or newer) implementation problems

kmsrihari
Posts: 26
Joined: Thu Feb 06, 2014 11:26 am

Using dynamic file names in UniversalDataWriter

Postby kmsrihari » Thu Feb 06, 2014 11:44 am

Hi,

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.

Any help would be highly appreciated.

Thanks,
Sreehareesh

imriskal
Posts: 399
Joined: Wed Aug 15, 2012 8:18 am

Re: Using dynamic file names in UniversalDataWriter

Postby imriskal » Thu Feb 06, 2014 1:41 pm

Hello Sreehareesh,

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

Is this solution sufficient for you?

Kind regards,
---
Lubos Imriska
CloverCARE Support
CloverDX

Visit us online at http://www.cloverdx.com

kmsrihari
Posts: 26
Joined: Thu Feb 06, 2014 11:26 am

Re: Using dynamic file names in UniversalDataWriter

Postby kmsrihari » Sat Feb 08, 2014 5:04 pm

Hi,

It makes perfect sense!
Now I'm able to get it worked with your solution.
Thanks a lot for your valuable help.

Thanks,
Sreehareesh

rz4qk4
Posts: 2
Joined: Fri Apr 11, 2014 10:37 am

Re: Using dynamic file names in UniversalDataWriter

Postby rz4qk4 » Fri Apr 11, 2014 10:54 am

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?

Thanks,
Michael.

imriskal
Posts: 399
Joined: Wed Aug 15, 2012 8:18 am

Re: Using dynamic file names in UniversalDataWriter

Postby imriskal » Fri Apr 11, 2014 3:02 pm

Hello Michael,

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.

Regards,
---
Lubos Imriska
CloverCARE Support
CloverDX

Visit us online at http://www.cloverdx.com

rz4qk4
Posts: 2
Joined: Fri Apr 11, 2014 10:37 am

Re: Using dynamic file names in UniversalDataWriter

Postby rz4qk4 » Tue Apr 15, 2014 10:46 am

Hi,

It's work perfectly fine now, thanks~

Michael.

siddhant
Posts: 9
Joined: Fri Nov 06, 2015 8:38 am

Re: Using dynamic file names in UniversalDataWriter

Postby siddhant » Tue Dec 22, 2015 8:32 am

hi guys,

i want to dynamically attach a id from a database or to my http file URL
can some body pls help

slechtaj
Posts: 192
Joined: Wed Aug 15, 2012 8:18 am

Re: Using dynamic file names in UniversalDataWriter

Postby slechtaj » Mon Jan 04, 2016 4:10 pm

Hi,

I believe this question was answered as part of this thread. Or is there anything else you need to clarify?
Jan Slechta
CloverCARE Support
CloverETL | Rapid Data Integration

Visit us online at http://www.cloveretl.com

How to speed up communication with CloverCARE support


cron