Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
gopinak

New User

Joined: 23 Mar 2010
Posts: 1
Location: chennai

 Posted: Wed May 09, 2018 1:53 pm    Post subject: Removing the period or dot from the value using cobol logic. 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

expat

Global Moderator

Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

 Posted: Wed May 09, 2018 2:28 pm    Post subject: What have you tried so far, and what results do you get ? What did Mr Google suggest ?
Robert Sample

Global Moderator

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

 Posted: Wed May 09, 2018 5:11 pm    Post subject: Depending upon your version of COBOL, FUNCTION NUMVAL might be of assistance.
Rohit Umarjikar

Global Moderator

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

 Posted: Wed May 09, 2018 9:03 pm    Post subject: 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.
enrico-sorichetti

Senior Member

Joined: 14 Mar 2007
Posts: 10701
Location: italy

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

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
Chetan Kumar

New User

Joined: 03 Dec 2012
Posts: 42
Location: India

 Posted: Fri May 11, 2018 8:14 pm    Post subject: Reply to: Removing the period or dot from the value using cobol logic. 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..
Rohit Umarjikar

Global Moderator

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

Posted: Fri May 11, 2018 9:35 pm    Post subject:

 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?
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Missing Negative sign in COBOL jzhardy COBOL Programming 6 Sat Sep 26, 2020 11:32 am COBOL reading from SYSIN jzhardy COBOL Programming 1 Mon Sep 21, 2020 2:37 pm how to read accounting information in... jzhardy COBOL Programming 1 Mon Sep 21, 2020 9:57 am Sync logic between VSAM files and DB2... murali.andaluri COBOL Programming 9 Tue Aug 25, 2020 1:01 pm NOT IN clause in COBOL pgm mramvivek COBOL Programming 8 Thu Aug 20, 2020 4:48 am

 © 2003-2020 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us