Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search 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 -> NATURAL & MQSERIES
Author Message
prasanth_urs

New User


Joined: 04 Dec 2006
Posts: 28
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
References
PostPosted: Tue Apr 17, 2007 4:15 pm    Post subject: Re: How to remove the triling zeros and balnks Reply with quote

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 2414
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: 28
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: 2970
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

Global Moderator


Joined: 23 Nov 2006
Posts: 6884
Location: 221 B Baker St

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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> NATURAL & MQSERIES All times are GMT + 6 Hours
Page 1 of 1