Page 1 of 1

Trnasformer issue

Posted: Thu Mar 13, 2008 7:49 pm
by just4u_sharath
Lets say i have a job like dataset--->transformer--->flatfile. In Transformer, input contains all fields from dataset and output of transformer contains only one filed name COL1 for which the derivation is harcoded to 'H'. (this is a sample job. in this we are not using the data from dataset). Now when i run the job, if the data is available in dataset, then the transformer executes and creates H in COL1 field of flat file. But when the dataset is empty, transformer never creates H in COL1 of flat file. i cannot understand this. Because the output field is hardccoded(independent of input data) and when i run the job it should produce H irrespective on input data of dataset.
IF we have data in dataset, it is producing H. If we dont have data, outpu tin flatfile is empty. How can i make the transformer running and produce H in sequential file eventhough there is no data in dataset.

Re: Trnasformer issue

Posted: Thu Mar 13, 2008 8:12 pm
by chulett
Ok..."i have a job like dataset--->transformer--->flatfile."

(sorry, had to get that out of the way)
just4u_sharath wrote:i cannot understand this.
Why not? No data in equals no data out.
just4u_sharath then wrote:Because the output field is hardccoded(independent of input data) and when i run the job it should produce H irrespective on input data of dataset.
Nothing is 'independent of input data', so the assertion made here is incorrect.
just4u_sharath lastly wrote:IF we have data in dataset, it is producing H. If we dont have data, output in flatfile is empty. How can i make the transformer running and produce H in sequential file even though there is no data in dataset.
You'd need to ensure that at least one record flows through your job even if your 'dataset' / source doesn't produce any records. Then join the two streams if you actually need the data from your source. If you don't, why not just use something like a Row Generator to trigger this?

Re: Trnasformer issue

Posted: Fri Mar 14, 2008 11:13 am
by just4u_sharath
chulett wrote:Ok..."i have a job like dataset--->transformer--->flatfile."

(sorry, had to get that out of the way)
just4u_sharath wrote:i cannot understand this.
Why not? No data in equals no data out.
just4u_sharath then wrote:Because the output field is hardccoded(independent of input data) and when i run the job it should produce H irrespective on input data of dataset.
Nothing is 'independent of input data', so the assertion made here is incorrect.
just4u_sharath lastly wrote:IF we have data in dataset, it is producing H. If we dont have data, output in flatfile is empty. How can i make the transformer running and produce H in sequential file even though there is no data in dataset.
You'd need to ensure that at least one record flows through your job even if your 'dataset' / source doesn't produce any records. Then join the two streams if you actually need the data from your source. If you don't, why not just use something like a Row Generator to trigger this?
Dataset takes either an input or output link. So its full. Transformer cannot accept more than 1 input link. Flat file is also the same. So where can i use rowgenerator to trigger this. Actually in the flat file COL1 field the derivation will be built using the stage variable of transformer and parameters of job. So eventhough there is no input data, transformer stagevariables should execute and produce the output in flat file. How this can be achieved?

Posted: Fri Mar 14, 2008 11:39 am
by crouse
Try reading the dataset and a row generator into a funnel and then into the transformer. As chulett says, you have to have data in in order to have data out.

Posted: Fri Mar 14, 2008 11:42 am
by crouse
Try reading the dataset and a row generator into a funnel and then into the transformer. As chulett says, you have to have data in in order to have data out.