Rules To Be Followed For Concatenation

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
praguur86
Participant
Posts: 42
Joined: Wed Jun 24, 2009 6:52 am
Location: Bangalore

Rules To Be Followed For Concatenation

Post by praguur86 »

I am trying to concate more than two columns of data type char to one column, but i am able to concate only two columns but not all......
please suggest me how can i achieve this....
Is there any rules or modification need to be follow to do ......
Prasad Gururao
jcthornton
Premium Member
Premium Member
Posts: 79
Joined: Thu Mar 22, 2007 4:58 pm
Location: USA

Post by jcthornton »

How are you trying to concatenate the columns together? The exact code would be best if you can post it.

Are there any error messages? Warnings? If so, what are they?

I would also consider what the datatypes are that you are trying to concatenate. If there are any fields that are not a char/varchar type, use an explicit conversion routine. Also, are you using null handling routines for the nullable columns?
Jack Thornton
----------------
Spectacular achievement is always preceded by spectacular preparation - Robert H. Schuller
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Also, which stage are you using to do this?
praguur86
Participant
Posts: 42
Joined: Wed Jun 24, 2009 6:52 am
Location: Bangalore

Post by praguur86 »

Following is the code i am using...
If IsNull(DSLink3.FIRSTNAME) Then ',' Else Trim(DSLink3.FIRSTNAME) : ',' : If IsNull(DSLink3.LASTNAME) Then ',' Else Trim(DSLink3.LASTNAME)

And i am not getting any warrning or error.Job is completing successfully.
I am handling null also.
Prasad Gururao
praguur86
Participant
Posts: 42
Joined: Wed Jun 24, 2009 6:52 am
Location: Bangalore

Post by praguur86 »

I am using Transformer Stage....
Prasad Gururao
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

praguur86 wrote:Following is the code i am using...
If IsNull(DSLink3.FIRSTNAME) Then ',' Else Trim(DSLink3.FIRSTNAME) : ',' : If IsNull(DSLink3.LASTNAME) Then ',' Else Trim(DSLink3.LASTNAME)

And i am not getting any warrning or error.Job is completing successfully.
I am handling null also.
Only two columns are mentioned here. This might be why you are not getting more column values in the result.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
praguur86
Participant
Posts: 42
Joined: Wed Jun 24, 2009 6:52 am
Location: Bangalore

Post by praguur86 »

any updates regarding concatination...
i tried to achive using table level concatenation, there als i am facing problem
Prasad Gururao
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Can you provide the full transformation rule with the input and output values to explain the issue you are facing.

Without that others can do very little only.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Just... keep going. You can string together as many if-then-else statements between colons as you'd like.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply