View previous topic :: View next topic
|
Author |
Message |
Kelly Kilpatrick
New User
Joined: 19 Sep 2006 Posts: 2
|
|
|
|
For debugging purposes I would like to display the hex value for a field. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi Kelly,
The easiest way is to redefine the field as a PIC X field and DISPLAY that.
For eg.:
Code: |
05 pd-field PIC S99999V99.
05 funky-data REDEFINES pd-field PIC XXXX. |
Then via SDSF look at your sysout with "hex on". You'll see the data between the >< mentioned below.
When DISPLAYing fields that have funky data, I usually do this:
Code: |
DISPLAY '>' FUNKY-DATA '<'
|
The data between the >< is what you displayed. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Kelly,
Here's a tried and true method -
Code: |
03 WS-PACKED PIC 9(17) PACKED-DECIMAL.
03 WS-PACKED-V9 REDEFINES WS-PACKED
PIC 9(16)V9 PACKED-DECIMAL.
03 WS-PACKED-X REDEFINES WS-PACKED
PIC X(09).
03 WS-DISPLAY PIC 9(17).
03 WS-DISPLAY-V9 REDEFINES WS-DISPLAY
PIC 9(16)V9.
03 WS-DISPLAY-X REDEFINES WS-DISPLAY
PIC X(17).
MOVE X'0F' TO WS-PACKED-X (LENGTH OF WS-PACKED-X:)
MOVE X'0123456789ABCDEF' TO WS-PACKED-X (1:LENGTH OF WS-PACKED-X - 1).
MOVE WS-PACKED-V9 TO WS-DISPLAY-V9.
INSPECT WS-DISPLAY-X CONVERTING X'FAFBFCFDFEFF'
TO 'ABCDEF'.
DISPLAY WS-DISPLAY-X (1:LENGTH OF WS-DISPLAY-X - 1).
|
After the INSPECT, field WS-DISPLAY-X (1:LENGTH OF WS-DISPLAY-X - 1) will equal '0123456789ABCDEF'.
Note that these fields must be defined as UNSIGNED.
HTH....
Regards,
Bill |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Kelly,
Quote: |
For debugging purposes I would like to display the hex value for a field. |
Are you using any debugging tool (like expediter)? |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
WOW,
DBz, CICS Guy, and now, Bill O'Boyle.
You guys must be getting desperate.
Not much going on over there. |
|
Back to top |
|
|
|