View previous topic :: View next topic
|
Author |
Message |
Ramanan-R
New User
Joined: 21 Mar 2007 Posts: 66 Location: Chennai, Tamilnadu, India
|
|
|
|
Hi All ,
A file has a binary field (4 bytes) holding 9 digit numeric value. The requirement is to convert that binary field from COMP/Binary format to ZD/Display format.
I tried below codes in Syncsort, but both are providing different output values but EDIT option gives the required output. Can anyone explain their difference?
Code: |
1. OUTREC FIELDS=(1,4,BI,TO=ZD,LENGTH=9) >> Output got: 00002000H
2. OUTREC FIELDS=(1,4,BI,EDIT=(TTTTTTTTT)) >> Output got: 000020008 |
Thanks in advance!
Regards,
Ramanan R |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
In a zoned-decimal field, the sign is the high-order nibble of the low-order byte. The letter H is the value for a positive 8. For a negative 8, the value would be Q.
Signed Positive values have a "C" sign (H is x'C8') and Signed Negative values have a "D" sign (Q is x'D8'). There is an "implied positive that has an "F" sign, so the number is visable (8 is x'F8'). |
|
Back to top |
|
|
Ramanan-R
New User
Joined: 21 Mar 2007 Posts: 66 Location: Chennai, Tamilnadu, India
|
|
|
|
Hi Dick,
Thanks for the information.
Can you pls explain how H is mapped to +8 and Q mapped to -8
Thanks again...
Regards,
Ramanan R |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Please re-read the previous reply. That is the explanation. . .
Suggest you edit a member and key in A-I and J-R. Then turn HEX ON. You will see positive and negative 1 thru 9. I'll leave it to you to discover plus and minus zero. |
|
Back to top |
|
|
Ramanan-R
New User
Joined: 21 Mar 2007 Posts: 66 Location: Chennai, Tamilnadu, India
|
|
|
|
Hi Dick,
I tried as you advised and got the below results...
Code: |
ABCDEFGHIJKLMNOPQRSTUVWXYZ+-0
CCCCCCCCCDDDDDDDDDEEEEEEEE46F4
12345678912345678923456789E000 |
Thanks!
Ramanan R |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
You're welcome
Now, i suggest editing that file/member and inserting 2 more values in hex - x'C0' and x'D0'. Then you will have a "complete" set of signed zoned-decimal values from zero thru 9. |
|
Back to top |
|
|
Ramanan-R
New User
Joined: 21 Mar 2007 Posts: 66 Location: Chennai, Tamilnadu, India
|
|
|
|
Hi Dick...
Thanks again... Below is the output...
Code: |
{ABCDEFGHI}JKLMNOPQRSTUVWXYZ+-0123456789
CCCCCCCCCCDDDDDDDDDDEEEEEEEE46FFFFFFFFFF4
0123456789012345678923456789E001234567890 |
Regards,
Ramanan R |
|
Back to top |
|
|
skkp2006
New User
Joined: 14 Jul 2006 Posts: 93 Location: Chennai,India
|
|
|
|
maybe this can add a little help....
The following is a table identifying the zoned decimal hex characters.
Code: |
Last -----Character (Hex Code)-----
Digit Unsigned Positive Negative
----- -------- -------- --------
0 "0" (F0) "{" (C0) "}" (D0)
1 "1" (F1) "A" (C1) "J" (D1)
2 "2" (F2) "B" (C2) "K" (D2)
3 "3" (F3) "C" (C3) "L" (D3)
4 "4" (F4) "D" (C4) "M" (D4)
5 "5" (F5) "E" (C5) "N" (D5)
6 "6" (F6) "F" (C6) "O" (D6)
7 "7" (F7) "G" (C7) "P" (D7)
8 "8" (F8) "H" (C8) "Q" (D8)
9 "9" (F9) "I" (C9) "R" (D9) |
Syam |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Thanks again... Below is the output... |
You're welcome
Everywhere i have a logon, i have a member like this containing all of the hex values possible for one byte:
Code: |
hex table
88A4A889844444444444444444444444
85703123500000000000000000000000
--------------------------------
04040404040404040404040404040404
00102030405060708090A0B0C0D0E0F0
--------------------------------
14141414141414141414141414141414
00102030405060708090A0B0C0D0E0F0
--------------------------------
.
.
- / Â Ä À Á Ã Å Ç Ñ ¦ , % _ > ?
64646464646464646464646464646464
00102030405060708090A0B0C0D0E0F0
--------------------------------
ø É Ê Ë È Í Î Ï Ì ` : # @ ' = "
74747474747474747474747474747474
00102030405060708090A0B0C0D0E0F0
--------------------------------
.
.
} J K L M N O P Q R ¹ û ü ù ú ÿ
D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4D4
00102030405060708090A0B0C0D0E0F0
--------------------------------
\ ÷ S T U V W X Y Z ² Ô Ö Ò Ó Õ
E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4E4
00102030405060708090A0B0C0D0E0F0
--------------------------------
0 1 2 3 4 5 6 7 8 9 ³ Û Ü Ù Ú
F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4F4
00102030405060708090A0B0C0D0E0F0
-------------------------------- |
This is only partial (you can fill in the others) but i find it valuable to have this available. It works on the mainframe, UNIX, and Win-based systems. And even on the mainframe the display values of same characters change from one situation to another. |
|
Back to top |
|
|
|