Changing the edited COBOL filed to numeric field.

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Post Reply
S Dayal
Registered Member
Posts: 10
Joined: Thu Jan 30, 2014 9:57 am

Changing the edited COBOL filed to numeric field.

Post by S Dayal »

Hi,

For a requirement I need to Change the edited COBOL filed to numeric field. Like, the field is like $123,456,789. This field needs to be used in computation, how can I do that?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1896
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Changing the edited COBOL filed to numeric field.

Post by Robert Sample »

Use FUNCTION NUMVALC to convert it back to a number.
Ashish Mathew
Registered Member
Posts: 50
Joined: Thu Jun 27, 2013 6:17 pm

Re: Changing the edited COBOL filed to numeric field.

Post by Ashish Mathew »

We can also use NUMVAL.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1896
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Changing the edited COBOL filed to numeric field.

Post by Robert Sample »

Except NUMVAL does not handle currency symbols while NUMVALC does. Since the posted example has a currency symbol, that is why I recommended NUMVALC over NUMVAL.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.”