Modify 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
ds_is_fun
Premium Member
Premium Member
Posts: 194
Joined: Fri Jan 07, 2005 12:00 pm

Post by ds_is_fun »

Another way to do the same thing. Is
In your source column nullable = "Y" and target columns Nullable = "N"
Use a If Then Else statement
Like...
If IsNull(col1) Then <default_value> Else (col1)
This should also work.
ds_is_fun
Premium Member
Premium Member
Posts: 194
Joined: Fri Jan 07, 2005 12:00 pm

Post by ds_is_fun »

ds_is_fun wrote:Another way to do the same thing. Is
In your source column nullable = "Y" and target columns Nullable = "N"
Use a If Then Else statement
Like...
If IsNull(col1) Then <default_value> Else (col1)
This should also work.
Sorry forgot to mention use the above in a transformer stage.
thebird
Participant
Posts: 254
Joined: Thu Jan 06, 2005 12:11 am
Location: India
Contact:

Post by thebird »

Hi,

I want to avoid the use of a transformer. Thats why I was trying to use a modify stage. Use of transformer I think impacts the efficiency.

Regards,

Thebird.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Is both your from and to mapping string values?
thebird
Participant
Posts: 254
Joined: Thu Jan 06, 2005 12:11 am
Location: India
Contact:

Post by thebird »

Hi,

My input and output are both strings. The exact statements that I entered was :

1)Latitude:string = NullToValue (Latitude,"NULL")
2)Latitude=NullToValue (Latitude,"NULL")
3)Latitude=NullToValue("NULL")

I also tried NullToZero in the above staments, inside the Modify stage.
But every time, the job log said

unknown conversion: NullToValue/NullToZero
expected field selector,got:")"

When I tried using NullToEmpty, though the job ran, the incoming raw didnt seem to have changed at all.

Can anyone help me with this?

Regards,

Thebird.
richdhan
Premium Member
Premium Member
Posts: 364
Joined: Thu Feb 12, 2004 12:24 am

Post by richdhan »

Hi Bird,

This has been discussed before. Do a search on handle_null. Modify stage uses orchestrate functions. Use handle_null in the modify stage specification.

Rich
battaliou
Participant
Posts: 155
Joined: Mon Feb 24, 2003 7:28 am
Location: London
Contact:

Post by battaliou »

handle_null seems to be the way forward here, but in the PX developer pdf, they have a NullToValue example under the modify stage. Surely this function should be available? I'm happy with the work around.
3NF: Every non-key attribute must provide a fact about the key, the whole key, and nothing but the key. So help me Codd.
kiran reddy
Participant
Posts: 5
Joined: Wed Apr 20, 2005 6:29 pm
Location: USA

Post by kiran reddy »

Hi,
Modify Operator does not exactly behave as described in the PX documentation. If you have a chance go through the Orchestrate documentation.
I am doing the same by HANDLE_NULL
This would definitely work.

Stat_Qanty = HANDLE_NULL(Stat_Qanty,0)
Stat_Qanty = HANDLE_NULL(Stat_Qanty,value) for a numeric type


Name = HANDLE_NULL(Name,'value') for string type
Thanks,
Kiran Kumar Reddy
kiran reddy
Participant
Posts: 5
Joined: Wed Apr 20, 2005 6:29 pm
Location: USA

Post by kiran reddy »

In my previous message I forgot to stress on using only single quotes for a string type using HANDLE_NULL
Thanks,
Kiran Kumar Reddy
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

One of many errors in the manual. The functions that the Modify stage uses are similar but different from the functions that the Transformer stage uses; for example many of the Modify stage function names include underscores.
Maybe they'll become more consistent in a future release. Meanwhile you need to research and experiment to find what works (and share it here!).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply