Page 1 of 1

Transformer Stage

Posted: Wed Mar 16, 2005 8:30 pm
by naren6876
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

Re: Transformer Stage

Posted: Wed Mar 16, 2005 8:36 pm
by bchau
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?
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.

Posted: Wed Mar 16, 2005 8:38 pm
by kcbland
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.

Posted: Wed Mar 16, 2005 9:11 pm
by naren6876
How to set a filename as a job parameter?
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.

Posted: Wed Mar 16, 2005 9:44 pm
by kcbland
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:

Code: Select all

/path/path/path/#FRED#.dat
or you can have the path already in the parameter value so just:

Code: Select all

#FRED#.dat
or you can even have the extension in the parameter value so just:

Code: Select all

#FRED#
In the transformer stage, you can just use FRED literally in the column derivation.

Posted: Thu Mar 17, 2005 3:09 am
by Sainath.Srinivasan
You can achieve this using FOLDER stage attached to your file. One of the property of the Folder is to return the filename it is currently operating on.

Posted: Thu Mar 17, 2005 8:32 am
by naren6876
hi

Posted: Thu Mar 17, 2005 10:06 am
by naren6876
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

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:

Code: Select all

/path/path/path/#FRED#.dat
or you can have the path already in the parameter value so just:

Code: Select all

#FRED#.dat
or you can even have the extension in the parameter value so just:

Code: Select all

#FRED#
In the transformer stage, you can just use FRED literally in the column derivation.

Posted: Sun Mar 20, 2005 7:11 am
by roy
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,