Trnasformer issue

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
just4u_sharath
Premium Member
Premium Member
Posts: 236
Joined: Sun Apr 01, 2007 7:41 am
Location: Michigan

Trnasformer issue

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: Trnasformer issue

Post 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?
-craig

"You can never have too many knives" -- Logan Nine Fingers
just4u_sharath
Premium Member
Premium Member
Posts: 236
Joined: Sun Apr 01, 2007 7:41 am
Location: Michigan

Re: Trnasformer issue

Post 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?
crouse
Charter Member
Charter Member
Posts: 204
Joined: Sun Oct 05, 2003 12:59 pm
Contact:

Post 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.
Craig Rouse
Griffin Resouces, Inc
www.griffinresources.com
crouse
Charter Member
Charter Member
Posts: 204
Joined: Sun Oct 05, 2003 12:59 pm
Contact:

Post 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.
Craig Rouse
Griffin Resouces, Inc
www.griffinresources.com
Post Reply