NullToEmtpy 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
highpoint
Premium Member
Premium Member
Posts: 123
Joined: Sat Jun 19, 2010 12:01 am
Location: Chicago

NullToEmtpy Issue

Post by highpoint »

Hi,

I always seems to have problem with NullToEmpty function.

In the current scenario both all the source and target columns are varchar.

The NulltoEmpty does not work and seems to act differently in different jobs.

Code: Select all

If col1=100 then Nulltoempty(col2) else''
The below always work.

Code: Select all

If col1=100 and isnotnull(col2) then col2 else''


Are there any limitations with the use of nulltoempty function

Appreciate reply.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The only limitation of which I am aware is that the target column must be VarChar data type.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
way246
Participant
Posts: 7
Joined: Wed Sep 01, 2010 9:06 am
Location: Europe

Re: NullToEmtpy Issue

Post by way246 »

The NulltoEmpty does not work and seems to act differently in different jobs.
[code]If col1=100 then Nulltoempty(col2) else''[/code]

The below always work.
[code]If col1=100 and isnotnull(col2) then col2 else''[/code]

Name Description Arguments Output
[b]IsNotNull[/b] Returns true when an expression does not evaluate to the null value any true/false (int8)
[b]NullToEmpty[/b] Returns an empty string if input column is null, otherwise returns the input column value input column input column
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Please explain more fully, with examples, what "does not work" means in this context.
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