Author |
Message
|
pcelari |
Posted: Mon Aug 03, 2009 7:11 am Post subject: FileOutput node: how to use variable in Filename field? |
|
|
Chevalier
Joined: 31 Mar 2006 Posts: 411 Location: New York
|
Hi,
I use a FileOutput node to send file over FTP to a remote location. I saved a timestamp-related extention in a shared variable, FileExt.
But how can I use this varible in the "File name or pattern" field of the FileOutput node? For example, Orders.${FileExt}?
thanks a lot for any insight.
 _________________ pcelari
-----------------------------------------
- a master of always being a newbie |
|
Back to top |
|
 |
zpat |
Posted: Mon Aug 03, 2009 7:27 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Doesn't need to be shared. Just set in compute node, e.g.
SET OutputLocalEnvironment.Destination.File.Name = 'Orders.' || FileExt; |
|
Back to top |
|
 |
smdavies99 |
Posted: Mon Aug 03, 2009 7:40 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
The solution is in the Documentation
AND
if you look at the greyed out path in the properites of the fileoutput node in the toolkit. just change the sort of xpath style to '.' notation. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
pcelari |
Posted: Tue Aug 04, 2009 4:43 am Post subject: |
|
|
Chevalier
Joined: 31 Mar 2006 Posts: 411 Location: New York
|
many thanks for the insights!
How come I didn't see such capabilities in the document?
Will make it work and report back with my solution. _________________ pcelari
-----------------------------------------
- a master of always being a newbie |
|
Back to top |
|
 |
pcelari |
Posted: Tue Aug 04, 2009 12:16 pm Post subject: |
|
|
Chevalier
Joined: 31 Mar 2006 Posts: 411 Location: New York
|
zpat wrote: |
Doesn't need to be shared. Just set in compute node, e.g.
SET OutputLocalEnvironment.Destination.File.Name = 'Orders.' || FileExt; |
it works this way. I used the timestamp function to add the extra extention directly:
set OutputLocalEnvironment.Destination.File.Name =
InputLocalEnvironment.File.Name || '.' ||
substring(cast(InputLocalEnvironment.File.TimeStamp as char) before '_');
Yet, one thing puzzles me was that I have to put the same code in compute nodes in both routes - FileInput out - FileOutput In, and FileInput End of Data - FileOutput Finish File.
If one of the routes doesn't have this code, I'll get exception complaining about failure in composing message, because the field is empty, although I put a default file pattern '*' in the FileOutput node properties.
I consider this duplicate unnecessary.
 _________________ pcelari
-----------------------------------------
- a master of always being a newbie |
|
Back to top |
|
 |
|