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
 

 

Why COMP data doesnt display the value correctly

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

New User


Joined: 01 Jan 2008
Posts: 35
Location: Hyderabad

PostPosted: Sun Jan 27, 2008 1:38 pm    Post subject: Why COMP data doesnt display the value correctly
Reply with quote

I think this must have been asked earlier in the forum but my search did not help me. Please help me understand why does not a display of comp-3 or comp data provide correct results.
Back to top
View user's profile Send private message

Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Sun Jan 27, 2008 8:30 pm    Post subject: Re: Why COMP data doesnt display the value correctly
Reply with quote

Kevin Dcosta wrote:
I think this must have been asked earlier in the forum but my search did not help me. Please help me understand why does not a display of comp-3 or comp data provide correct results.


It does!
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Mon Jan 28, 2008 12:54 am    Post subject:
Reply with quote

Kevin,

Tell us about what you're trying to DISPLAY. Give us the PIC and the VALUE of the data field.

Then tell us what is being DISPLAYed.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Jan 28, 2008 8:40 am    Post subject:
Reply with quote

Hello,

To sucessfully display comp and/or comp-3 data, you need to display the individual field(s), not some group field.
Back to top
View user's profile Send private message
Kevin Dcosta

New User


Joined: 01 Jan 2008
Posts: 35
Location: Hyderabad

PostPosted: Mon Jan 28, 2008 12:08 pm    Post subject: Reply to: Why COMP data doesnt display the value correctly
Reply with quote

Below are the details

01 WS-SNUM05PD PIC S9(5) COMP-3.
01 WS-SNUM05BI PIC S9(5) COMP.

MOVE -12345 TO WS-SNUM05PD WS-SNUM05BI

Output.

PACK DECIMAL :1234N
BINARY :000001234N
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Mon Jan 28, 2008 2:49 pm    Post subject:
Reply with quote

it is displaying as advertised.

Code:

**********************************************************************
*  VALUES:                                                           *
*      1 = A          -1 = J     EXAMPLES:  NUMBER    REPRESENTATION *
*      2 = B          -2 = K                  10        00000001{    *
*      3 = C          -3 = L                 105        00000010E    *
*      4 = D          -4 = M                   0        00000000{    *
*      5 = E          -5 = N                -234        00000023M    *
*      6 = F          -6 = O                 -30        00000003}    *
*      7 = G          -7 = P                                         *
*      8 = H          -8 = Q                                         *
*      9 = I          -9 = R                                         *
*      0 = {          -0 = }                                         *
**********************************************************************


Back to top
View user's profile Send private message
Kevin Dcosta

New User


Joined: 01 Jan 2008
Posts: 35
Location: Hyderabad

PostPosted: Mon Jan 28, 2008 4:22 pm    Post subject: Reply to: Why COMP data doesnt display the value correctly
Reply with quote

Thanks to all .
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Tue Jan 29, 2008 7:58 am    Post subject:
Reply with quote

You could:

WS
Code:
01 WS-SNUM05PD PIC S9(5) COMP-3.
01 WS-SNUM05BI PIC S9(5) COMP.
01 WS-DISP-VAL PIC -----9.


PD
Code:
MOVE -12345         TO WS-SNUM05PD WS-SNUM05BI
COMPUTE WS-DISP-VAL  = WS-SNUM05PD
DISPLAY WS-SNUM05PD
COMPUTE WS-DISP-VAL  = WS-SNUM05BI
DISPLAY WS-SNUM05BI

SYSOUT
Code:
-12345
-12345
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 copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts Display upon console bipinpeter COBOL Programming 1 Thu Jun 22, 2017 12:35 am


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