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

Author Message
Gousiya Mulla

New User

Joined: 02 Jun 2008
Posts: 87
Location: Bangalore

 Posted: Wed May 19, 2010 9:16 pm    Post subject: COBOL - extract values after Decimal point Given : 63.020003 How can we extract values after decimal point using COBOL logic . Form my end , if it is alphanumeric we can use the String Functions (like substr) to extract . But not sure how it is for numeric ones ...... Please any idea ??

dbzTHEdinosauer

Global Moderator

Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

 Posted: Wed May 19, 2010 9:29 pm    Post subject: how about: given PIC 9(5)v9(10) value 63.020003. gt-decimal pic 9(10). lt-one PIC v9(10). move given to gt-decimal, lt-one. after move: gt-decimal contains 0000000063 lt-one contains 0200030000
Marso

REXX Moderator

Joined: 13 Mar 2006
Posts: 1275
Location: Israel

Posted: Wed May 19, 2010 10:53 pm    Post subject: Re: COBOL - extract values after Decimal point

 Gousiya Mulla wrote: if it is alphanumeric we can use the String Functions (like substr) to extract
almost...
STRING is used to concatenate values, UNSTRING is used to split them.
and STRING / UNSTRING are not functions.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Linkage editor is part of COBOL, z/OS... ankit.jain COBOL Programming 4 Fri Apr 20, 2018 4:17 pm Difference between EQUAL and EQUAL TO... jithinraghavan COBOL Programming 3 Thu Apr 19, 2018 2:22 am Call COBOL or PLI with a click from w... vaibhav gs All Other Mainframe Topics 1 Mon Apr 16, 2018 7:29 pm LOW VALUES as a KEY juares castro DB2 10 Sat Apr 07, 2018 1:06 am COBOL MVS options BiswajitDG COBOL Programming 8 Fri Apr 06, 2018 12:35 am

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