View previous topic :: View next topic
|
Author |
Message |
Roy Ware
New User
Joined: 19 Sep 2013 Posts: 14 Location: USA
|
|
|
|
Another odd question!
I want to take a 4 byte binary field and convert it into a text field of 8 bytes with each zone and digit as a character. For example, for input I have:
and would like to see the output as
Can this be done in SyncSort? |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2010 Location: USA
|
|
|
|
This is not "display as a character", but "display as a hexadecimal".
Not in SYNCSORT (and other SORTs, too) |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2010 Location: USA
|
|
|
|
Not tested: try to use parameter of OUTREC/OUTFIL:
Code: |
... BUILD=(...,p,l,TRAN=HEX,...) |
If it works OK, let us know, too. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2010 Location: USA
|
|
|
|
Yes, it works
Code: |
//TRANHEX EXEC PGM=SYNCSORT
//*
//SYSOUT DD SYSOUT=*
//SORTIN DD *
123456789
ABCDEFGHIJKLMNOPQRSTUVWXYZ
abcdefghijklmnopqrstuvwxyz
//*
//SORTOUT DD SYSOUT=*
//*
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1,26,HEX)
END
//* |
Result:
Code: |
----+----1----+----2----+----3----+----4----+----5--
F1F2F3F4F5F6F7F8F94040404040404040404040404040404040
C1C2C3C4C5C6C7C8C9D1D2D3D4D5D6D7D8D9E2E3E4E5E6E7E8E9
818283848586878889919293949596979899A2A3A4A5A6A7A8A9
******************************** Bottom of Data **** |
|
|
Back to top |
|
|
|