Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to remove the triling zeros and balnks

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Java & MQSeries
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    Post subject: How to remove the triling zeros and balnks
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Tue Apr 17, 2007 4:47 pm    Post subject: Re: How to remove the triling zeros and balnks
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    Post subject: Re: How to remove the triling zeros and balnks
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: 3158
Location: Tucson AZ

PostPosted: Wed Apr 18, 2007 1:25 pm    Post subject:
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

Site Director


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

PostPosted: Wed Apr 18, 2007 11:29 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> Java & MQSeries All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm
No new posts Remove junk values in a file and rite... KP1125 DFSORT/ICETOOL 2 Wed Jan 25, 2017 9:58 pm
No new posts Sort Card to Remove Duplicate records... raj4neo SYNCSORT 2 Wed Jan 25, 2017 4:44 am
No new posts Remove Special Characters from Mainfr... Rodger Zhang All Other Mainframe Topics 6 Wed Jul 06, 2016 1:12 am
No new posts Join key - Populate Zeros when Unpair... rexx77 DFSORT/ICETOOL 6 Thu May 12, 2016 12:22 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us