hisabarinath Beginner
Joined: 25 Apr 2008 Posts: 36 Topics: 8 Location: Baltimore, USA
|
Posted: Wed Mar 25, 2009 9:51 am Post subject: replace spaces instead of zeros thru COBOL Utility |
|
|
I have searched but couldnt find the earlier post.
Thru COBOL Program, i want to replace prefix with zeros instead of spaces. My requirement is i have a price field of X(6).X(5) - this field should convert to 9(11)V9(5).
for eg-
Code: | ----+----1----+----2----+----3----+----4----+--
PRICE FIELD - CONVERT THE PRICE FIELD TO
123456.12345 - 00000123456.12345
45.88888 - 00000000045.88888
999.00000 - 00000000999.00000
.88000 - 00000000000.88000
5.00001 - 00000000005.00001 |
More information-
The decimal part X(5) always be fixed and there is NO space allowed, and the period also fixed in the 7th postion of the given price field. I have tried thru redefines and all string handling but unable to get the desired result.
It seems simple, but unable to handle, if some one have posted earlier, please share me the link. Thanks for your help. |
|