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: 6966
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 Data replication from multiple Db2 ta... kishpra DB2 5 Mon Mar 27, 2017 9:58 pm
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts Display FTP Session Count within TSO Yolanda Harvey TSO/ISPF 3 Fri Mar 10, 2017 10:31 pm


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