Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Removing the period or dot from the value using cobol logic.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
gopinak

New User


Joined: 23 Mar 2010
Posts: 1
Location: chennai

PostPosted: Wed May 09, 2018 1:53 pm    Post subject: Removing the period or dot from the value using cobol logic.
Reply with quote

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
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8666
Location: Back in jolly old England

PostPosted: Wed May 09, 2018 2:28 pm    Post subject:
Reply with quote

What have you tried so far, and what results do you get ?

What did Mr Google suggest ?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8319
Location: Dubuque, Iowa, USA

PostPosted: Wed May 09, 2018 5:11 pm    Post subject:
Reply with quote

Depending upon your version of COBOL, FUNCTION NUMVAL might be of assistance.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1896
Location: NY,USA

PostPosted: Wed May 09, 2018 9:03 pm    Post subject:
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Moderator


Joined: 14 Mar 2007
Posts: 10475
Location: italy

PostPosted: Wed May 09, 2018 9:31 pm    Post subject: Reply to: Removing the period or dot from the value using cobol logic.
Reply with quote

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
View user's profile Send private message
Chetan Kumar

New User


Joined: 03 Dec 2012
Posts: 41
Location: India

PostPosted: Fri May 11, 2018 8:14 pm    Post subject: Reply to: Removing the period or dot from the value using cobol logic.
Reply with 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..
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1896
Location: NY,USA

PostPosted: Fri May 11, 2018 9:35 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to convert 2 bytes into single by... pkmurali DB2 4 Fri May 25, 2018 1:41 pm
No new posts SYSADATA - COBOL - Structure displace... ganasrinivasan COBOL Programming 3 Thu May 24, 2018 9:45 pm
No new posts Cobol program till a given time or fo... ankita agarwal COBOL Programming 7 Fri May 18, 2018 2:24 pm
No new posts Compute statement with Cobol Z/os 5.2 Chetan Kumar COBOL Programming 2 Fri May 11, 2018 8:02 pm
No new posts Ways to share data between Cobol and ... Benchwarmer Java & MQSeries 3 Thu May 10, 2018 9:16 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us