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: 8714
Location: Welsh Wales

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: 8391
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: 2016
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

Senior Member


Joined: 14 Mar 2007
Posts: 10516
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: 2016
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 COBOL - JSON GENERATE husni1972 COBOL Programming 1 Fri Aug 17, 2018 3:29 am
No new posts SQL IN predicate using COBOL table jerryte DB2 16 Fri Jun 29, 2018 10:30 pm
No new posts Converting SAS code to Cobol or Easyt... Ashish.Raghav All Other Mainframe Topics 6 Fri Jun 29, 2018 6:01 pm
No new posts Can we use a file both as input and o... Chiku kumar COBOL Programming 6 Thu Jun 28, 2018 3:30 pm
No new posts Varying List Select SQL Query In DB2 ... NikhilGuptaGaya DB2 5 Wed Jun 27, 2018 11:01 pm

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