One Star

Building and Using Variables For tFTPPut Filemask

I'm very new to Talend. I've written a couple very useful scripts at this point. However, I need to get a bit more advanced and was hoping someone could point me in the direction of the documentations / examples to read in order to accomplish it.
I writing a script using tFTPPut to sFTP a file from my local system to a vendor. I have it working with a specified file for the filemask. Unfortunately, the vendor requires this file to have a name with the date embedded. So, the file name will be different every time the file needs to be sent.
I can program. Since it's based on the date, this is a programmatic issue. My first two questions are, then ...

Where do I do my programming to build the date string I need and ...
How do I use that variable in the filemask portion of the tFTPPut action.
Like I said, I'm hoping someone can jump start me by pointing to some appropriate reading material. I'm perfectly capable of figuring it out, I just need to get pointed down the right road, first.
Thanks,
Quintin
3 REPLIES
Moderator

Re: Building and Using Variables For tFTPPut Filemask

Hi Quintin,
What does your script look like?
For your use case, would you mind setting an example for us?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: Building and Using Variables For tFTPPut Filemask

I'm not exactly sure how to present this to you so if there is a better way than what I have done, just say so.
It's a very simple script ...

The tSystem_1 executes a VBS script developed by a supplier to extract data from their SaaS system.
 
tFTPPut_1 uses sFTP to send that file to a vendor.
 
You will notice in the 'Filemask' that the file name has an embedded data. Somehow, I need to use use yesterday's date to build that YYMMDD string (160629 in the screenshot supplied) and then use that string to build the filename (Delta-834.160629) to be used in the filemask.
One Star

Re: Building and Using Variables For tFTPPut Filemask

I found this tutorial on how to pass a parameter through a context variable.
http://talend-etl-tutorials.blogspot.com/2013/12/talend-begineers-qucik-understanding-of.html
Applying that information would mean instead of coding my file name string within Talend, I could code it outside and pass that string to the (super basic) job that just performed the sFTP operation.
Would that be the best methodology to tackle this with?