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
 
COBOL - extract values after Decimal point

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
Gousiya Mulla

New User


Joined: 02 Jun 2008
Posts: 87
Location: Bangalore

PostPosted: Wed May 19, 2010 9:16 pm    Post subject: COBOL - extract values after Decimal point
Reply with quote

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

dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed May 19, 2010 9:29 pm    Post subject:
Reply with quote

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

REXX Moderator


Joined: 13 Mar 2006
Posts: 1243
Location: Israel

PostPosted: Wed May 19, 2010 10:53 pm    Post subject: Re: COBOL - extract values after Decimal point
Reply with quote

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.
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts Spool Extract for Z /os 1.04 version Khadhar Basha CLIST & REXX 3 Thu Sep 28, 2017 3:14 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts Working with hex values in Filemanage... Emile Straker IBM Tools 0 Tue Sep 12, 2017 1:42 am

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