|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Conversion Problem |
« View previous topic :: View next topic » |
Author |
Message
|
satyasheel15 |
Posted: Sun May 18, 2003 9:18 pm Post subject: Conversion Problem |
|
|
Voyager
Joined: 04 Mar 2003 Posts: 86
|
Problem:
I am working in a message Set where the Input Values is String with fixed length = 18.
And I want the output as converted into DECIMAL(14,4).
For example,
my input value is: 221145678905678567
and I want my output as : 22114567890567,8567
Please advise.
Regards Always
Satyasheel |
|
Back to top |
|
 |
shalabh1976 |
Posted: Mon May 19, 2003 8:39 am Post subject: |
|
|
 Partisan
Joined: 18 Jul 2002 Posts: 381 Location: Gurgaon, India
|
CAST(element as DECIMAL(14,4))
should do it |
|
Back to top |
|
 |
kirani |
Posted: Tue May 20, 2003 7:42 pm Post subject: Re: Conversion Problem |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
satyasheel15 wrote: |
For example,
my input value is: 221145678905678567
and I want my output as : 22114567890567,8567
|
It seems you are expecting output data into STRING format. If so, try this:
Code: |
DECLARE TMP CHAR;
SET TMP = SUBSTRING(inputvalue FROM 1 FOR 14) || ',' || SUBSTRING(inputvalue FROM 15 FOR 4);
|
_________________ 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 |
|
 |
|
|
 |
|
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
|
|
|
|