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
 
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 How to display offset thru cobol prog... tvinodkumar7 CICS 2 Sun Apr 22, 2018 8:42 pm
No new posts Sort numeric fields with trailing spaces sancraig16 SYNCSORT 7 Tue Apr 03, 2018 1:21 am
No new posts how to display APL characters? Pedro TSO/ISPF 6 Wed Mar 14, 2018 5:07 am
No new posts Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts display the sign only if the value is... useit DFSORT/ICETOOL 3 Wed Oct 04, 2017 5:53 pm

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