|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How to get a string lenght of a variable ?? |
« View previous topic :: View next topic » |
Author |
Message
|
elvis_gn |
Posted: Mon Nov 29, 2004 8:51 pm Post subject: How to get a string lenght of a variable ?? |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi,
I am using a variable,suppose 'A'.
I wanted to know how I can know the string length of the variable.
I actually want to append the variable string to a fixed length.
Example:
If I have 'A' = elvis stored,but I want a fixed length of 10 how can i append '0' to it to make it '00000elvis'. The data in the variable will be different in size depending upon a XML input. |
|
Back to top |
|
 |
JT |
Posted: Mon Nov 29, 2004 9:01 pm Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
Try something like this (untested):
Code: |
SET A = SUBSTRING('0000000000' FROM 1 FOR (10 - LENGTH(A))) || A; |
|
|
Back to top |
|
 |
kirani |
Posted: Mon Nov 29, 2004 11:28 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
If you are modeling your messae using MRM then you can use padding feature to pad your output data with any char. You can also mention whether you want that element value to be left justified or right justified. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
elvis_gn |
Posted: Tue Nov 30, 2004 4:06 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hey thanks a lot,
I used the code in all ways possible and it works. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|