String Concatenation

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
nkln@you
Premium Member
Premium Member
Posts: 271
Joined: Wed Nov 17, 2004 5:15 am
Location: US

String Concatenation

Post by nkln@you »

I am doing the follwoing derivation in Transformer.

If Write_Reversal.END_USER_NAME<> Read_SpaChannelHistory.END_USER_NAME Then 'AOO |' Else '' : '|' : If Write_Reversal.CHANNEL_FLAG<> Read_SpaChannelHistory.CHANNEL_FLAG Then 'CF' Else ''

While Testing the 1st If condition is true AND Second If Condition is True.

So, the output should be AOO|COO

But I am getting output as AOO|

If I give derivation as 'AOO |' : If Write_Reversal.CHANNEL_FLAG<> Read_SpaChannelHistory.CHANNEL_FLAG Then 'CF' Else ''

The output is coming as AOO|CF

What is wrong with my original derivation.
Aim high
paddu
Premium Member
Premium Member
Posts: 232
Joined: Tue Feb 22, 2005 11:14 am
Location: California

Post by paddu »

(If( Write_Reversal.END_USER_NAME<> Read_SpaChannelHistory.END_USER_NAME Then 'AOO |') Else '') : '|' : ( If (Write_Reversal.CHANNEL_FLAG<> Read_SpaChannelHistory.CHANNEL_FLAG Then 'CF' )Else '' )

try using this
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Else to make it more clear assign each expression in individual Stage variable and concatinate the variables.

Code: Select all

vStageVar1 =? If Write_Reversal.END_USER_NAME<> Read_SpaChannelHistory.END_USER_NAME Then 'AOO |' Else ''

VStrageVar2 => If Write_Reversal.CHANNEL_FLAG<> Read_SpaChannelHistory.CHANNEL_FLAG Then 'CF' Else ''

Expression => vStageVar1:vStageVar2
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply