Sidebar

how can I write an FTP path: with a system node tag?

0 votes
499 views
asked Jan 23, 2014 by (170 points)
trying this but does not work. /folder/$$PXIDX?{SYSTEM_DATE-2d[MMddyy]}.txt

the ? is a file number, the actual file name is $$PXIDX4011214.txt, I have multiple files with a diff file number.  

Thank you

1 Answer

0 votes
 
Best answer
I would setup the filename within a custom mapping node, store it in the message cache, and then use it in the path of the destination node ...

//setup our variable name
var variable = 4;

//get today's date
var todaysDate = qie.deduceDate(qie.getSystemDate());

//subtract 2 days
todaysDate.setDate(todaysDate.getDate()-2);

//create the filename string
var filename = '$$PXIDX' + variable.toString() + qie.formatDate('MMddyy', qie.deduceDate(todaysDate)) + '.txt';

//store it in the messageCache
messageCache.setValue('filename', filename);

 

then, in your destination node, use the channel cache variable in the filename:

D:\Outbound\{c:filename}.txt

which created a file named : $$PXIDX4012714.txt
answered Jan 30, 2014 by matt-w-2627 (3,220 points)
selected Jan 30, 2014 by sam-s-1510
...