View previous topic :: View next topic
|
Author |
Message |
Radha3
New User
Joined: 17 Apr 2008 Posts: 4 Location: Bangalore
|
|
|
|
Hi can anyone anyone help regarding this query
I have a field ABCD PIC X(1) that stores values in
hexadecimal format eg. X'21'
There is another field AAAA PIC X(2)
I want to move ABCD to AAAA so that value in AAAA
comes out to be 21. |
|
Back to top |
|
|
vasanthkumarhb
Active User
Joined: 06 Sep 2007 Posts: 275 Location: Bang,iflex
|
|
|
|
Hi,
if u force the value 21 to store in to variable ABCD the value get truncated
and i guess hexadecimal of numeric 21 is 2B.
afterwards you can convert hexdecimal to numeric or watever u like to change.
there are functions in COBOL to convert hex to other formatts and vice versa. |
|
Back to top |
|
|
Radha3
New User
Joined: 17 Apr 2008 Posts: 4 Location: Bangalore
|
|
|
|
What are those functions which are available in COBOL? Can you please tell me.. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
if u force the value 21 to store in to variable ABCD the value get truncated |
This is incorrect (or at least mis-understood in terms of the request). The request is how to "move" an x'21' (perfectly valid in one byte) to 2 bytes that contain x'F2F1' or 21.
Quote: |
and i guess hexadecimal of numeric 21 is 2B. |
Has nothing to do with the request.
One way is to define an array of 2-byte entries of all of the values from x'00' to x'FF' and then use the single byte as the displacement into the array.
If i remember, someone also posted a way to "calculate" this and a search in the forum could find it. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
Back to top |
|
|
|