View previous topic :: View next topic
|
Author |
Message |
j_sram
New User
Joined: 03 Jul 2006 Posts: 6
|
|
|
|
I have hex value as X'0F1D'. I want to move to X(4) variable as 0F1D
So, that If I display alphanumeric field, I should able to see as 0F1D
-----------
If Hex as value X'FF' it should come as FF
For X'1dFF0D1C' as 1dFF0D1C
The target alphanumeric field will have twice the size of hex value field. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
There are lots of ways. Here's [http://www.ibmmainframes.com/viewtopic.php?p=115071#115071]one[/url].
A simple way is to have a table of 256 two-byte values, and the use each byte of your input as a subscript
Code: |
01 subscript-name BINARY PIC 9(4) VALUE ZERO.
01 FILLER REDEFINES subscript-name.
05 FILLER PIC X.
05 input-byte-here PIC X. |
MOVE each input byte successively to input-byte-here and use subscript-name to put each character pair into your output. |
|
Back to top |
|
|
|