View previous topic :: View next topic
|
Author |
Message |
Kevin Dcosta
New User
Joined: 01 Jan 2008 Posts: 35 Location: Hyderabad
|
|
|
|
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 |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
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 |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Kevin Dcosta
New User
Joined: 01 Jan 2008 Posts: 35 Location: Hyderabad
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
Kevin Dcosta
New User
Joined: 01 Jan 2008 Posts: 35 Location: Hyderabad
|
|
|
|
Thanks to all . |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
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
|
|
Back to top |
|
|
|