Transformer Stage
Moderators: chulett, rschirm, roy
Transformer Stage
Hi
Is there a way to pass the filename being loaded from a sequential file stage into a transformer stage in order to have the filename included as an output field?
Thanks in advance for your help.
Naren
Is there a way to pass the filename being loaded from a sequential file stage into a transformer stage in order to have the filename included as an output field?
Thanks in advance for your help.
Naren
Re: Transformer Stage
A ghetto way of doing it would be to set a job parameter with the file name and output a column with the filename....you could also input it manually without the parameter.naren6876 wrote: Is there a way to pass the filename being loaded from a sequential file stage into a transformer stage in order to have the filename included as an output field?
Only if you used a job parameter as the filename, then the job parameter is also available in the transformer. Otherwise, unless you are willing to use an reverse-engineered method for retrieving job design information, no.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
How to set a filename as a job parameter?
please explain me
thanks,
naren
please explain me
thanks,
naren
kcbland wrote:Only if you used a job parameter as the filename, then the job parameter is also available in the transformer. Otherwise, unless you are willing to use an reverse-engineered method for retrieving job design information, no.
Add the filename as a job parameter, for example. FRED. At runtime, supply FRED a value using the smart job control you are working on. In the Sequential stage under the filename, use FRED like this:
or you can have the path already in the parameter value so just:
or you can even have the extension in the parameter value so just:
In the transformer stage, you can just use FRED literally in the column derivation.
Code: Select all
/path/path/path/#FRED#.dat
Code: Select all
#FRED#.dat
Code: Select all
#FRED#
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Thanks Ken.It works fine for me.
I have a folder which contains filenames.
Now i want to pass this Filenames at runtime.How can i implement this?
Any clues pls
Naren
I have a folder which contains filenames.
Now i want to pass this Filenames at runtime.How can i implement this?
Any clues pls
Naren
kcbland wrote:Add the filename as a job parameter, for example. FRED. At runtime, supply FRED a value using the smart job control you are working on. In the Sequential stage under the filename, use FRED like this:
or you can have the path already in the parameter value so just:Code: Select all
/path/path/path/#FRED#.dat
or you can even have the extension in the parameter value so just:Code: Select all
#FRED#.dat
In the transformer stage, you can just use FRED literally in the column derivation.Code: Select all
#FRED#
Hi,
I generally prefer a basic routine to gain list of files from a directory,
for 2 reasons:
1. folder stage should not be used if the diretory contains directories.
2. folder stage might fail with large files (varies per configuration, usually over 100MB or so).
a search in this forum should get you the basic code you need to do the job.
IHTH,
I generally prefer a basic routine to gain list of files from a directory,
for 2 reasons:
1. folder stage should not be used if the diretory contains directories.
2. folder stage might fail with large files (varies per configuration, usually over 100MB or so).
a search in this forum should get you the basic code you need to do the job.
IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org