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
 

 

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 find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts IDC2902I Error tzeche ABENDS & Debugging 2 Tue Mar 28, 2017 11:39 am
No new posts Need help with below DB2 error ashek15 DB2 3 Sat Mar 18, 2017 5:56 am
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm


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