Concatination not working

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
pradkumar
Charter Member
Charter Member
Posts: 393
Joined: Wed Oct 18, 2006 1:09 pm

Concatination not working

Post 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
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post 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?
You are the creator of your destiny - Swami Vivekananda
AmeyJoshi14
Participant
Posts: 334
Joined: Fri Dec 01, 2006 5:17 am
Location: Texas

Post 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!
http://findingjobsindatastage.blogspot.com/
Theory is when you know all and nothing works. Practice is when all works and nobody knows why. In this case we have put together theory and practice: nothing works. and nobody knows why! (Albert Einstein)
pradkumar
Charter Member
Charter Member
Posts: 393
Joined: Wed Oct 18, 2006 1:09 pm

Post 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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Are there any nulls?

Concatenating anything with null will result in null.

Otherwise show us the exact expression you are using.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
pradkumar
Charter Member
Charter Member
Posts: 393
Joined: Wed Oct 18, 2006 1:09 pm

Post 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.
Pradeep Kumar
Post Reply