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

display numeric item incorrectly


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
frankvhe

New User


Joined: 22 Jun 2005
Posts: 2

PostPosted: Wed Jun 22, 2005 8:41 am
Reply with quote

declared two numeric item
item-on-hand pic s9(5).
item-sold pic s9(5).

in the procedure division
... ...
subtract item-sold from item-on-hand.
... ...
display item-sold.

I did it in z/OS. the correct answer should be 05390
but what I got is 0539{
when the right answer should be 10543
what I got is 1054C

any comments or ideas on what is the problem?
thanks in advance

icon_mad.gif
Back to top
View user's profile Send private message
kvivek

New User


Joined: 09 May 2005
Posts: 51
Location: Singapore

PostPosted: Wed Jun 22, 2005 2:31 pm
Reply with quote

This is due to sign bit(S). Declare another variable WS-DISPLAY PIC -9(05).

MOVE item-sold TO WS-DISPLAY and display WS-DISPLAY.

Regards,
Vivek
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 Convert HEX to Numeric DB2 3
No new posts Find a record count/numeric is multip... COBOL Programming 1
No new posts How to display the leading zeros of a... DB2 7
No new posts TSQ Item Count increments to plus 1 CICS 1
No new posts Handling the numeric data in unstring... COBOL Programming 18
Search our Forums:

Back to Top