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
 

 

display numeric item incorrectly

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: display numeric item incorrectly
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    Post subject:
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    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 Display upon console bipinpeter COBOL Programming 1 Thu Jun 22, 2017 12:35 am
No new posts Validate if a Value from the file is ... balacsv2 COBOL Programming 8 Mon Jun 19, 2017 11:52 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Display FTP Session Count within TSO Yolanda Harvey TSO/ISPF 3 Fri Mar 10, 2017 10:31 pm


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