|
|
![]() |
|
|
|
|
||
|
Hex Dump of an IFS File Hey, Ted: How can I get a hexadecimal dump of an IFS file?
-- Charles Use the od utility, which runs under Qshell. Use the t option to tell od which format(s) you want to see. Here's a list of all the formats you can request.
To display a file in hexadecimal, follow the t option with an x. I can illustrate with a simple text file, which I'll call err.log. The CCSID attribute is 37, which means the data is stored in EBCDIC. You can use the cat command to see the contents of the file in character format. (The Qshell commands I typed are in boldface. The response from Qshell is in italics.) cat err.log ls: 001-2113 Error found getting information for object zz*. cat: 001-0023 Error found opening file out.log. Per your request, here's the file in hex. od -t x err.log 0000000 93a27a40 f0f0f160 f2f1f1f3 40c59999 0000020 96994086 96a49584 408785a3 a3899587 0000040 40899586 96999481 a3899695 40869699 0000060 40968291 8583a340 a9a95c4b 258381a3 0000100 7a40f0f0 f160f0f0 f2f340c5 99999699 0000120 408696a4 95844096 97859589 95874086 0000140 89938540 96a4a34b 9396874b 25000000 0000155 You might find it helpful to view the file in both character and hex at once.
od -t cx err.log
0000000 l s : 0 0 1 - 2 1 1 3 E r r
93a27a40 f0f0f160 f2f1f1f3 40c59999
0000020 o r f o u n d g e t t i n g
96994086 96a49584 408785a3 a3899587
0000040 i n f o r m a t i o n f o r
40899586 96999481 a3899695 40869699
0000060 o b j e c t z z * . 045 c a t
40968291 8583a340 a9a95c4b 258381a3
0000100 : 0 0 1 - 0 0 2 3 E r r o r
7a40f0f0 f160f0f0 f2f340c5 99999699
0000120 f o u n d o p e n i n g f
408696a4 95844096 97859589 95874086
0000140 i l e o u t . l o g . 045
89938540 96a4a34b 9396874b 25000000
0000155
Notice the two instances of 045 in the character output. These are octal numbers that represent the line feed character, which Qshell uses by default as an end-of-line marker. The hexadecimal equivalent, with which you may be familiar, is X'25'. Think about it: four eights plus five is the same as two sixteens plus five. Od dumps the data as it is, so CCSID matters. Suppose err.log had a CCSID of 819. Here's how the hex dump would look. od -t x err.log 0000000 6c733a20 3030312d 32313133 20457272 0000020 6f722066 6f756e64 20676574 74696e67 0000040 20696e66 6f726d61 74696f6e 20666f72 0000060 206f626a 65637420 7a7a2a2e 0a636174 0000100 3a203030 312d3030 32332045 72726f72 0000120 20666f75 6e64206f 70656e69 6e672066 0000140 696c6520 6f75742e 6c6f672e 0a000000 0000155 If the data is not stored in EBCDIC format, using the c option with od will give you a lot of octal numbers, not readable characters. -- Ted
|
Editors
Contact the Editors |
|
Last Updated: 10/18/02 Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved. |