How do I concatenate two input Character fields
Moderators: chulett, rschirm, roy
-
- Charter Member
- Posts: 17
- Joined: Tue Mar 21, 2006 1:00 pm
How do I concatenate two input Character fields
I am trying to take firstname and lastname fields and concatenate into a fullname in a transform stage and getting only firstname in fullname field. What am I missing here. I defined these are stage variables and deriving fullname stage variable.
This kind of concatenation worked with numeric fields in another job.
This kind of concatenation worked with numeric fields in another job.
-
- Participant
- Posts: 147
- Joined: Sat Apr 30, 2005 1:23 am
- Location: Bangalore,India
-
- Charter Member
- Posts: 17
- Joined: Tue Mar 21, 2006 1:00 pm
-
- Charter Member
- Posts: 17
- Joined: Tue Mar 21, 2006 1:00 pm
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Nothing should be in quotes.
Create another output link from the Transformer stage containing the values from the stage variables and the value from the derivation. Run this into, say, a Peek stage; inspect the results and diagnose.
You may discover (for example) that LastName is truly empty in some of your source records.
Create another output link from the Transformer stage containing the values from the stage variables and the value from the derivation. Run this into, say, a Peek stage; inspect the results and diagnose.
You may discover (for example) that LastName is truly empty in some of your source records.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Charter Member
- Posts: 17
- Joined: Tue Mar 21, 2006 1:00 pm
[quote="narasimha"]Lets get some more details here.
What is your source? (File, DB,...)
Also can you post the exact derivation you have used for your Stage Variables.
My source is output from FTP_Plugin from a Windows Server ( Excel Spread sheet). How do I attach the screen shot here ? Or do I need to e-mail you the screen shot ( This is first time I am in a forum ).
What is your source? (File, DB,...)
Also can you post the exact derivation you have used for your Stage Variables.
My source is output from FTP_Plugin from a Windows Server ( Excel Spread sheet). How do I attach the screen shot here ? Or do I need to e-mail you the screen shot ( This is first time I am in a forum ).
-
- Charter Member
- Posts: 17
- Joined: Tue Mar 21, 2006 1:00 pm
Hi, That is what I am actually doing to diagnose the problem. I am creating a output with just the fullname, firstname and lastname. The first and last name stage variables are defined as 20 varchar but when I tried to find the length I am getting 20. It is as if the white space is counted too. I tried all options like (Whitespace, Trim, TrimLeadingTrailing) and all of these are returning back the length of these fields as 20. This is what is confusing me a lot.ray.wurlod wrote:Nothing should be in quotes.
Create another output link from the Transformer stage containing the values from the stage variables and the value from the derivation. Run this into, say, a Peek stage; inspect the results and diagnose.
You may discover (for example) that LastName is truly empty in some of your source records.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
How are you asking for the length to be reported? Create more output columns - define their derivations to use the Len() function.
Is the output file fixed-width format? If so, the fields will always be padded to length.
Is the output file fixed-width format? If so, the fields will always be padded to length.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Charter Member
- Posts: 17
- Joined: Tue Mar 21, 2006 1:00 pm
Yes. The output file is fixed width format. That explains why I am getting the length that way. I will try your suggestion and get back to you. Thanks a lot.ray.wurlod wrote:How are you asking for the length to be reported? Create more output columns - define their derivations to use the Len() function.
Is the output file fixed-width format? If so, the fields will always be padded to length.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Re: How do I concatenate two input Character fields
Just noticed this in the original post. Which suggests to me that the other job was a server job.TJX Companies wrote:This kind of concatenation worked with numeric fields in another job.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Charter Member
- Posts: 17
- Joined: Tue Mar 21, 2006 1:00 pm
Re: How do I concatenate two input Character fields
Hi, The job which worked is a parallel job. But the Input Sequential file is coming from a server job. Does that make any difference ?ray.wurlod wrote:Just noticed this in the original post. Which suggests to me that the other job was a server job.TJX Companies wrote:This kind of concatenation worked with numeric fields in another job.