View previous topic :: View next topic
|
Author |
Message |
gomu_mm
New User
Joined: 05 Dec 2006 Posts: 19 Location: Chennai
|
|
|
|
I have a file with 49 columns. I want the first 12 columns to be as such but columns from 13 to 49 should change to hexadecimal.
The file looks like this,
6203759820060000000000265084730000000000000
6203424720060000000000188060031000000000000 |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Please produce an example of what you want the output to look like.
Please provide a list of methods available to perform this change. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
gomu_mm,
Well, going by what I think you said you want, the DFSORT control statements would be:
Code: |
OPTION COPY
INREC BUILD=(1,12,13,37,HEX)
|
The output for your input example would be:
Code: |
620375982006F0F0F0F0F0F0F0F0F0F0F2F6F5F0F8F4F7F3F0F0F0F0F0F0F0F0F0F0F0F0F0404040404040
620342472006F0F0F0F0F0F0F0F0F0F0F1F8F8F0F6F0F0F3F1F0F0F0F0F0F0F0F0F0F0F0F0404040404040
|
Whether that's really what you want is another question. |
|
Back to top |
|
|
gomu_mm
New User
Joined: 05 Dec 2006 Posts: 19 Location: Chennai
|
|
|
|
Hi,
Thanks for your response.
I want the output as given below:
620306652007 Øà@
620306762007 < Êàæ
When I do HEX ON, it looks like,
000002 620306652007 Øà@
FFFFFFFFFFFF0000000011084700000000000044444444444444444444444444444444
62030665200700000C007C004C000C000C000C00000000000000000000000000000000
------------------------------------------------------------------------------
000003 620306762007 < Êàæ
FFFFFFFFFFFF0000000014074900000000000044444444444444444444444444444444
62030676200700000C005C024C000C000C000C00000000000000000000000000000000
My another doubt here is whether Hexa decimal and Packed decimal are the same? |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
gomu_mm wrote: |
My another doubt here is whether Hexa decimal and Packed decimal are the same? |
Yes, what you are defining as 'Hexa decimal' is packed numeric.
So what you really want is to convert from zoned (displayable) to packed numeric.
To do this, you must specify each input field by starting position and length.
Or try giving a display of one input record and the 'HEX ON' display of the input record after it has been converted....Or if you find it easier, the hex output record and what it would look like if it were input..... |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
When I do HEX ON, it looks like, |
The output records you show with HEX ON do not match the input records you showed in your first post.
You need to show a couple of input records and what you want the output records to look like in hex for THOSE INPUT RECORDS.
Quote: |
My another doubt here is whether Hexa decimal and Packed decimal are the same? |
Hexadecimal is just a way of displaying information - it is NOT a format per se.
Packed decimal is a format with a specific internal representation of d...ds (d is a digit, s is the sign). Hexadecimal can be used to show what packed decimal data (or zoned decimal data or binary data etc) looks like internally - it displays each 4 bits (a "nibble") as 0-F.
For example, a packed decimal value of +1234 would be displayed in hex as 01234C and a zoned decimal value of -1234 would be displayed in hex as F0F1F3D4. |
|
Back to top |
|
|
|