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
 
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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts display the sign only if the value is... useit DFSORT/ICETOOL 3 Wed Oct 04, 2017 5:53 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

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