Replacing '.' in amount



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Replacing '.' in amount

Postby seiko » Thu Sep 06, 2012 1:03 pm

How can i replace the period in amount using cobol?
e.g. 150000.00
I want it to be 15000000
seiko
 
Posts: 8
Joined: Fri Aug 31, 2012 8:04 am
Has thanked: 0 time
Been thanked: 0 time

Re: Replacing '.' in amount

Postby BillyBoyo » Thu Sep 06, 2012 2:03 pm

Does the field only contain "numbers"? If so, look at FUNCTION NUMVAL in the manual.

If not, let us know what it can contain.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Replacing '.' in amount

Postby NicC » Thu Sep 06, 2012 3:56 pm

or multiply by 100 - provided it is a numeric field with numerics in it.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Replacing '.' in amount

Postby dick scherrer » Thu Sep 06, 2012 7:57 pm

Hello,

or multiply by 100 - provided it is a numeric field with numerics in it.
And make sure the target field has no decimal places defined.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Replacing '.' in amount

Postby BillyBoyo » Thu Sep 06, 2012 8:17 pm

Unfortunately, any "maths2 with something that "looks like" this, 150000.00, ie has an actual fullstop/period, will go BANG! S0C7 :-)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post