View previous topic :: View next topic
|
Author |
Message |
gopinak
New User
Joined: 23 Mar 2010 Posts: 1 Location: chennai
|
|
|
|
One of the column is having decimal point in the value.
E.x 00006.0000
The declaration of the column is COLUMN1 PIC X(10)
This value should get changed or converted to '0000060000' without the decimal point.
Could you please help on the logic using cobol.
Thanks in advance |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
What have you tried so far, and what results do you get ?
What did Mr Google suggest ? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Depending upon your version of COBOL, FUNCTION NUMVAL might be of assistance. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
Also to substitute NUMVAL, logically, you can loop thru by advancing 1 by1 the field value and the moment you hit "." just skip that and move the rest to the target field. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
Could you please help on the logic using cobol. |
unless the programming language provides a function to perform a specific task
the logic for a RYO implementation of the same task will not depend on the programming language |
|
Back to top |
|
|
Chetan Kumar
New User
Joined: 03 Dec 2012 Posts: 46 Location: India
|
|
|
|
Move this value to array that occurs 10 times. Then read the values 1 by 1 thru perform loop and when you get to '.' , skip this value and write rest of the values from the loop to another array field. Hope this helps.. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3051 Location: NYC,USA
|
|
|
|
Quote: |
Move this value to array that occurs 10 times. Then read the values 1 by 1 thru perform loop and when you get to '.' , skip this value and write rest of the values from the loop to another array field. Hope this helps..
|
Why array when you could use Reference Modification as suggested before? |
|
Back to top |
|
|
|