Introducing New column in the Transformer Stage

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
Madhav_M
Participant
Posts: 43
Joined: Sat Jul 10, 2004 5:47 am

Introducing New column in the Transformer Stage

Post by Madhav_M »

Hi
In the transformer stage I introduced one new column(TMMBR_F) which has a derivation like if TMMBR_ADJ_A > 0 then 'Y' else 'N'.
In the input link to Transformer stage I am getting 100 rows in the output link from TRNS stage I am only getting 10 rows why is that..

Please throw some lights on this.

Thanks
Madhav.
Madhav_M
Participant
Posts: 43
Joined: Sat Jul 10, 2004 5:47 am

Post by Madhav_M »

FYI I am getting this info while running the job..
TRNS_SetTMMBR_F2,0: Field 'TMMBR_ADJ_A' from input dataset '0' is NULL. Record dropped.
Field 'TMMBR_ADJ_A' from input dataset '0' is NULL. Record dropped
richdhan
Premium Member
Premium Member
Posts: 364
Joined: Thu Feb 12, 2004 12:24 am

Post by richdhan »

Hi Madhav,

You have to handle null values for 'TMMBR_ADJ_A'.

You can use nulltovalue or use the if then else loop to check if the value is null or the value > 0 and provide appropriate values. Beacuse of nullablity 90 rows have been dropped from the input dataset.

HTH
--Rich

Pride comes before a fall
Humility comes before honour
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Do you have any output constraints on that link?

Otherwise, richdhan's advice about null values seems apposite.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
gh_amitava
Participant
Posts: 75
Joined: Tue May 13, 2003 4:14 am
Location: California
Contact:

Post by gh_amitava »

Hi,

You can use this

If IsNull(TMMBR_ADJ_A) = 1 Then <Some default value or Space(<Field Length>) Else If TMMBR_ADJ_A > 0 then 'Y' else 'N'.

Regards
~Amitava
dsxdev
Participant
Posts: 92
Joined: Mon Sep 20, 2004 8:37 am

Post by dsxdev »

Hi,
When ever you are using a function on an input column which is nullable,
it is better you handle nulls explicitly. Otherwise the records would be dropped when ever a null is encountered in that field.

As rightly pointed in above mails you can use IsNull or NullToValue functions to trap nulls.There are some morw functions available in the Transfomer Editor for null handling. You can use any of them as per your need.

Even IsNotNull would also help.
Happy DataStaging
Post Reply