Author |
Message
|
Regis |
Posted: Wed May 03, 2006 10:57 pm Post subject: String Concatenation problem |
|
|
Newbie
Joined: 03 May 2006 Posts: 3
|
Hi all,
I have a little problem with string concatenation. I'm new to ESQL and have no idea how to solve it.
An input message contains 4 fields of 35 chars which need to be concatenated to 1 field of 140 chars. But all the spaces at the end of each 35 chars need to be in the 140 chars string. If I use || it automaticaly trims the field. Is there a simple way around this problem?
I'm using MQSI 2.1.
Thanks in advance |
|
Back to top |
|
 |
shalabh1976 |
Posted: Wed May 03, 2006 11:03 pm Post subject: |
|
|
 Partisan
Joined: 18 Jul 2002 Posts: 381 Location: Gurgaon, India
|
Regis,
WMQI will not automatically trim any spaces, so the use of the concat operator(||) should be ok. Please use a trace to make sure that your input fields do indeed contain the spaces.
In fact, we need to use the TRIM operator to remove spaces. _________________ Shalabh
IBM Cert. WMB V6.0
IBM Cert. MQ V5.3 App. Prog.
IBM Cert. DB2 9 DB Associate |
|
Back to top |
|
 |
elvis_gn |
Posted: Wed May 03, 2006 11:10 pm Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi Regis,
I support shalabh1976 on this, it is news to me too that fields are being automatically trimmed by WMQI...
I guess either your message itself is trimmed or your message set is doing it for you....
I guess, you will still need to provide for the functionality of having spaces...in that case use OVERLAY with SPACE functions along with concat....
Regards. |
|
Back to top |
|
 |
Regis |
Posted: Wed May 03, 2006 11:26 pm Post subject: |
|
|
Newbie
Joined: 03 May 2006 Posts: 3
|
Shalabh and elvis_gn,
It seems I was wrong indeed. The input field was trimmed before it was passed. I'm gonna try to use OVERLAY instead of concatenation.
Thanks! |
|
Back to top |
|
 |
elvis_gn |
Posted: Wed May 03, 2006 11:30 pm Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi Regis,
Quote: |
I'm gonna try to use OVERLAY instead of concatenation. |
Why ? If your sure that the input WILL always be of length 35 then don't, its a waste of processing power....
But doing it using OVERLAY, SPACE and || will ensure that, whatever be the input, the code will take care...so its dynamic and closer to a service architecture
Regards. |
|
Back to top |
|
 |
Regis |
Posted: Wed May 03, 2006 11:37 pm Post subject: |
|
|
Newbie
Joined: 03 May 2006 Posts: 3
|
Elvis_gn,
Quote: |
Why ? If your sure that the input WILL always be of length 35 then don't, its a waste of processing power....
|
The input field is of variable length. The maximum length is 35 and I was told is was always 35 chars long. But it now turns out to be variable...
Kind regards |
|
Back to top |
|
 |
|