Page 1 of 1

Concatination not working

Posted: Wed Apr 14, 2010 10:03 am
by pradkumar
Hi Everyone.

How to concatinate different columns in transformer stage? I have 10 columns in the input of which 9 are char datatype and one is decimal. My reuqirement is to concatinate all the 10 fileds to one field use the field as key to merge. what i have done is created a new filed ABC of datatype varchar 255 and concatinated all the source 10 fields and loaded into dataset. But when i view the data i see only first 2 fields were concatinated. Please let me know where iam doing wrong. Share your ideas.

Thanks in Advance

Posted: Wed Apr 14, 2010 10:11 am
by anbu
If you have only 10 fields then read entire row as a single field.

Is your input fixed width file? Are you concatenating fields with different delimeter?

Posted: Wed Apr 14, 2010 10:49 am
by AmeyJoshi14
Hi,

For the decimal data type you have to use "DecimalToString" function and target datatype will be LongVarchar.
Following is code which I have used:

Code: Select all

DSLink2.COL1:DSLink2.COL2:DSLink2.COL3:DSLink2.COL4: DecimalToString(DSLink2.COL5)
Hope this will help you :wink:

Thanks!

Posted: Wed Apr 14, 2010 2:16 pm
by pradkumar
Hi,

I tried with by using the decimal to string fucntion but still not getting the desired output. Iam extracting the data from Mainframe DB2 tables. Is it something to do with the lowvalues? or inline nulls? if there are any chances of having low values could any one let me know how to convert and proceed with the logic.

Thanks

Posted: Thu Apr 15, 2010 12:44 am
by ArndW
pradkumar wrote:...I tried with by using the decimal to string fucntion but still not getting the desired output...
Since we don't know what your output was, or what your desired output was there is little that anyone here at DSXChange can do to help until you explain the issue.

Posted: Thu Apr 15, 2010 4:18 am
by ray.wurlod
Are there any nulls?

Concatenating anything with null will result in null.

Otherwise show us the exact expression you are using.

Posted: Thu Apr 15, 2010 9:04 am
by pradkumar
Hi Ray,

I found the reason for the issue. Out of 12 fields one of the field is of char datatype of length 10. But in the source sql iam doing substr [4,7]. So when i changed the length of the field from 10 to 7 it got worked.

Thanks for you suggestions.