IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Problem while dividing the numeric value


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 1448
Location: Chicago, IL

PostPosted: Fri Feb 24, 2006 8:27 pm
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Convert HEX to Numeric DB2 3
No new posts z/vm installation problem All Other Mainframe Topics 0
No new posts Find a record count/numeric is multip... COBOL Programming 1
Search our Forums:

Back to Top