ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to remove Leading Zeros

Post new topic  Reply to topic
 How to remove Leading Zeros « View previous topic :: View next topic » 
Author Message
SANTYP
PostPosted: Wed Mar 05, 2008 6:46 am    Post subject: How to remove Leading Zeros Reply with quote

Centurion

Joined: 27 Mar 2007
Posts: 142

Hi All,
Can Any one help me how to remove leading zeros...
Except casting that to integer..

like if I get input as 001205 then my output should be 1205..
with out casting the input value as integer..

Thanks in advance..
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Mar 05, 2008 6:56 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You mean you want to trim leading characters?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
SANTYP
PostPosted: Wed Mar 05, 2008 7:26 am    Post subject: Reply with quote

Centurion

Joined: 27 Mar 2007
Posts: 142

yes, but I got it..
Back to top
View user's profile Send private message
akir
PostPosted: Tue Apr 01, 2008 11:17 am    Post subject: Reply with quote

Acolyte

Joined: 28 Jun 2007
Posts: 51

SANTYP wrote:
yes, but I got it..
k
_________________
Thanks and Regards,
Akir

Tell everyone what you want to do and someone will want to help you do it.-W. Clement Stone
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
satya2481
PostPosted: Wed Apr 02, 2008 12:41 am    Post subject: Reply with quote

Disciple

Joined: 26 Apr 2007
Posts: 170
Location: Bengaluru

Hi SANTYP,

Could you please let us know how you implmented it in ESQL?

Bye
satya
_________________
IBM Certified Solution Developer WebSphere Message Broker V6.0
IBM Certified System Administrator WebSphere MQ V6.0
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Wed Apr 02, 2008 1:58 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

satya2481 wrote:
Hi SANTYP,

Could you please let us know how you implmented it in ESQL?

Bye
satya




I'm quite sure this was done by trimming leading characters.

_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
akir
PostPosted: Wed Apr 02, 2008 8:57 am    Post subject: Reply with quote

Acolyte

Joined: 28 Jun 2007
Posts: 51

satya2481 wrote:
implemented it in ESQL?

I think this is how it is done!!
Code:
-- In Customer Account Number leading zeroes are removed and set in Environment.            
         SET Environment.var.H010.CustAccNo = TRIM(LEADING '0' FROM InDataRef.HGRP_p[iHgrpIndex].H010_p[iH010Index].H010.CustomerAccNumber);

_________________
Thanks and Regards,
Akir

Tell everyone what you want to do and someone will want to help you do it.-W. Clement Stone
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Kazim_Baig
PostPosted: Tue Nov 01, 2016 11:21 pm    Post subject: Reply with quote

Novice

Joined: 26 Apr 2016
Posts: 19
Location: Bangalore

[quote="akir"][quote="satya2481"] implemented it in ESQL?[/quote]
I think this is how it is done!!
[code]-- In Customer Account Number leading zeroes are removed and set in Environment.
SET Environment.var.H010.CustAccNo = TRIM(LEADING '0' FROM InDataRef.HGRP_p[iHgrpIndex].H010_p[iH010Index].H010.CustomerAccNumber);
[/code][/quote]

I have used the above code, and it successful. But when the input itself is 000.000, the output for this will be .000 whereas I want it to be 0.000

Any suggestions?
Back to top
View user's profile Send private message Send e-mail
Kazim_Baig
PostPosted: Wed Nov 02, 2016 12:39 am    Post subject: Reply with quote

Novice

Joined: 26 Apr 2016
Posts: 19
Location: Bangalore

I have made use of IF Else condition like:

IF InputRoot.*.* = 0.00 Then
SET OutputRoot.XMLNSC.Value.Amount = 0.00;
Else
SET OutputRoot.XMLNSC.Value.Amount= TRIM(LEADING '0' FROM InputRoot.*.*);
END IF;
Back to top
View user's profile Send private message Send e-mail
timber
PostPosted: Wed Nov 02, 2016 12:46 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

It would be simpler to CAST to DECIMAL ( or FLOAT) and then CAST to CHARACTER with a FORMAT clause to control the style of the output string.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » How to remove Leading Zeros
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.