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
 
Output error when using COMP

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

New User


Joined: 17 Aug 2005
Posts: 30

PostPosted: Sat Dec 10, 2005 12:33 pm    Post subject: Output error when using COMP
Reply with quote

WORKING-STORAGE SECTION.

01 A PIC 9(4)V9(4).
01 B PIC 9(4)V9(4) COMP.
01 C PIC 9(3)V9(3) COMP.
01 D PIC 9(1)V999 COMP.
01 E PIC 9(3)V99 COMP.

PROCEDURE DIVISION.

MOVE 1234.5678 TO A,B,C,D,E
DISPLAY 'A= ',A.
DISPLAY 'B= ',B.
DISPLAY 'C= ',C.
DISPLAY 'D= ',D.
DISPLAY 'E= ',E.
STOP RUN.


Above shown is the program i have coded, but the value for D is showing wrong in the output.

The output is as follows

A= 12345678
B= 12345678
C= 234567
D= 4919
E= 23456

What would be the reason for this?
Can anyone please explain me.....?
Back to top
View user's profile Send private message

sbalajibe

New User


Joined: 15 Aug 2005
Posts: 62

PostPosted: Sat Dec 10, 2005 2:12 pm    Post subject:
Reply with quote

Initialze all the variables and check it again
it should not happen

thanks
balaji
Back to top
View user's profile Send private message
vrakeshmbt

New User


Joined: 17 Aug 2005
Posts: 30

PostPosted: Sat Dec 10, 2005 3:31 pm    Post subject:
Reply with quote

I have tried using the INITIALIZE variable also again i got the same.
I have tried using some other combinations on D as shown below...

4919 9V9(3) COMP.
919 V9(3) COMP.
7920 99V99 COMP.
4910 V9(4) COMP.
20 V99 COMP.
920 9V99 COMP.

The left side value shows the output for the corresponding right side declaration.

Any way thanks a lot balaji for ur reply
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 Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts CONDITIONAL USING COMP-2 WITH PROBLEMS. JOSUEGENTIL COBOL Programming 7 Wed Nov 08, 2017 11:13 pm
No new posts how can i move s9(9) to s9(9) usage comp HARENDRA CHOUDHARY COBOL Programming 3 Mon Nov 06, 2017 12:10 am
No new posts Copy selected columns from 2 input fi... Poha Eater DFSORT/ICETOOL 3 Thu Nov 02, 2017 3:43 pm

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