Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Problem while dividing the numeric value

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

New User


Joined: 24 Feb 2006
Posts: 3

PostPosted: Fri Feb 24, 2006 2:22 pm    Post subject: Problem while dividing the numeric value
Reply with quote

I am desperately looking for solution of following problem.
I have declared variable OUT-STRNG1 as 9(31).I am moving value 0034511705131000(having 16 digits) to it. I am deviding this variable by 97. The expected answer is 355790774546 with remainder 38. But some truncation is happening and wrong results are produced.I have also used compiler option PROCESS ARITH(EXTEND). I am concerned with only remainder as it should be used in further
Back to top
View user's profile Send private message

priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Fri Feb 24, 2006 8:27 pm    Post subject: Re: Problem while dividing the numeric value
Reply with quote

Rupali,

Quote:
I have declared variable OUT-STRNG1 as 9(31).

Please check almost similar doubt by some one else.... Can you define Numeric field with 31 digits position.
http://ibmmainframes.com/viewtopic.php?p=32636

Regards,

Priyesh.
Back to top
View user's profile Send private message
sailendranath

New User


Joined: 28 Feb 2006
Posts: 7
Location: bangalore

PostPosted: Tue Feb 28, 2006 2:25 pm    Post subject: Re: Problem while dividing the numeric value
Reply with quote

we cant declare numeric variable withmore than 18 bytes long.l
Back to top
View user's profile Send private message
rupali

New User


Joined: 24 Feb 2006
Posts: 3

PostPosted: Wed Mar 01, 2006 10:34 am    Post subject: Re: Problem while dividing the numeric value
Reply with quote

Hi Guys,
Problem is solved pretty well using compiler option PROCESS EXTEND(ARITH) AND using variable wich is right justified. Thanks for the help.
Rupali.
Back to top
View user's profile Send private message
amolsun

New User


Joined: 06 Aug 2005
Posts: 4
Location: pune

PostPosted: Wed Mar 01, 2006 3:55 pm    Post subject:
Reply with quote

i guess variable cant be declare with 31.
its upto 18 no. only possible
kindly correct me if wrong
Back to top
View user's profile Send private message
rupali

New User


Joined: 24 Feb 2006
Posts: 3

PostPosted: Thu Mar 02, 2006 11:04 am    Post subject: I have declared variable OUT-STRNG1 as 9(31).
Reply with quote

amo,
l i have declared it as 9(31) with the compiler option PROCESS ARITH(EXTEND) in my COBOL program and its working fine. so i think after using this option ,max numeric size we can use is 31.
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 Strings with double quotes having pro... raja Arumugam All Other Mainframe Topics 4 Thu Mar 30, 2017 10:34 am
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm
No new posts SYMNAMES problem jacobdng DFSORT/ICETOOL 7 Thu Dec 22, 2016 7:47 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us