I am using a condition in transformer to populate space values if two statements gets satisfied. My derivation is as below:
If (Column1=Column2 And Column3='') Then Column4='' Else Column4(It's incoming value) --> So in this condition column3 is having a datatype of Char(50). So, while executing this condition the output of the condition IF statement is getting satisfied as 0 instead of space. Column4 is also having a datatype of Char(50).
Requirement: Column4 should populate same as column3 value if, IF statement is satisfied or else it should populate it's original value coming from source. I am using datastage(v8.5). Also when writing to peek stage and seeing it is coming as 0. Tried all ways of Space(50), " ", ' ' etc.,
please help out on this. let me know if any details needed.
Note: Column3 is read from a dataset file. Suggest on this or let me know if I miss any piece of information in the question.
Thanks in Advance.!!
I have tried all the ways possible but couldn't able to populate spaces in Column4 which is having datatype same as Column3 i.e, Char(50)
In your derivation, the
Then Column4 = ''
is a conditional statement that is asking "Is Column4 equal to empty string?" returning a Boolean value;0
forFalse
and1
forTrue
. SinceColumn4
is aCHAR(50)
, this will always be'0'
.Instead, you need to return spaces (
''
,Spaces(50)
) in theThen
portion of your derivation.If Column1 = Column2 and Trim(Column3) = '' Then '' Else Column4
This now will return spaces when your condition (
Column1 equals Column2 and Trim(Column3) equals empty string
) is true and the originalColumn4
value when false.