IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to remove the triling zeros and balnks


IBM Mainframe Forums -> Java & MQSeries
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
prasanth_urs

New User


Joined: 04 Dec 2006
Posts: 44
Location: Pune,India

PostPosted: Tue Apr 17, 2007 4:15 pm
Reply with quote

Hi all,

Is there any function to remove the trailing zeros or blanks from a numeric filed.

For eg:-
A = 1067000000


I need to format A to B such a way that B should contain 1067 only.

Please let me know ASAP.

Many Thanks in advance.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Apr 17, 2007 4:47 pm
Reply with quote

Just a philosophical remark ....

usually in numbers trailing zeros have some meaning;

are You treating them as plain strings or You want to keep them as numbers,

just a curiosity

regards


P.S.
It happened quite often during my career as consultant that asking this kind of apparently "off topic" questio helped to clarify the issue being discussed
Back to top
View user's profile Send private message
prasanth_urs

New User


Joined: 04 Dec 2006
Posts: 44
Location: Pune,India

PostPosted: Wed Apr 18, 2007 11:31 am
Reply with quote

Hi ,

I got your point. But i need to remove the trailing zeros to make it in a different format.

If you know how to remove this,please let me know.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Apr 18, 2007 1:25 pm
Reply with quote

Reference modification and single byte testing from rear to front.
The intrinsic function REVERSE and maybe NUMVAL or examine replacing.
A simple move.
Byte-wise data manipulation is not that hard.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Apr 18, 2007 11:29 pm
Reply with quote

Hello,

Will the fieldA always have the same number of trailing zeros?

If it does, you could divide by the appropriate power of 10 and get the result you want. In your example, a divide by 1000000 (if i counted zeros correctly icon_smile.gif ) would get the 1067.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Java & MQSeries

 


Similar Topics
Topic Forum Replies
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Remove leading zeroes SYNCSORT 4
No new posts How to remove block of duplicates DFSORT/ICETOOL 8
No new posts To Remove spaces (which is in hex for... JCL & VSAM 10
No new posts How to remove spaces in between. SYNCSORT 12
Search our Forums:

Back to Top