Hello OR logic in 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
sushanth
Participant
Posts: 18
Joined: Sat Oct 09, 2004 10:13 am
Location: Malaysia
Contact:

Hello OR logic in transformer Stage

Post by sushanth »

Hai I need to change derivations in Transformer stage from OR logic to IF then Else if ,for the following Logic help
If IsNull(Tocl1) Or Len(Tocol1) = 0 Then 'sample' Else To col1



Yours
sanjay
Premium Member
Premium Member
Posts: 203
Joined: Fri Apr 23, 2004 2:22 am

Re: Hello OR logic in transformer Stage

Post by sanjay »

if IsNull(Tocl1) Then 0 else if
Len(Tocol1) = 0 Then 0 else
col1

Thanks


sushanth wrote:Hai I need to change derivations in Transformer stage from OR logic to IF then Else if ,for the following Logic help
If IsNull(Tocl1) Or Len(Tocol1) = 0 Then 'sample' Else To col1



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

Post by richdhan »

Hi Sushanth,

Just go ahead and change the derivation using the expression editor. If something is wrong it will appear in RED. Whatever logic you would like to apply just put it in the derivation using the expression editor. It should work.

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:

Re: Hello OR logic in transformer Stage

Post by ray.wurlod »

sushanth wrote:Hai I need to change derivations in Transformer stage from OR logic to IF then Else if ,for the following Logic help
If IsNull(Tocl1) Or Len(Tocol1) = 0 Then 'sample' Else Tocol1
Why do you need to change? The logic you have will work perfectly well.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sandy
Participant
Posts: 24
Joined: Sun Feb 01, 2004 1:14 am

Post by sandy »

Hi,

OR logic is not working as expected in the transformer and hence recently even we had to change all the OR conditions to If Then Else in the transformers. I think Sushant is also a victim of this issue.

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

Post by ray.wurlod »

The site I'm on at present isn't using PX, so I can't verify your claim. I trust you've reported it to Ascential?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

What you have is the old Oracle NVL function, if a value is empty or null replace it with a given value, else leave it alone. Why not write your own routine to do this which is passed the field value and the replacement value. In a routine you can use the Test button to make sure your code works and then use it in all your jobs. When you want to change it you only need to change it in one place and you do not need to recompile any jobs.
sushanth
Participant
Posts: 18
Joined: Sat Oct 09, 2004 10:13 am
Location: Malaysia
Contact:

OR Logic

Post by sushanth »

sandy wrote:Hi,

Yah you got it It happened like that
Thanks
Sushanth
Post Reply