View previous topic :: View next topic |
Author |
Message |
SK Beginner
Joined: 04 Feb 2004 Posts: 26 Topics: 3
|
Posted: Mon Feb 09, 2004 2:55 pm Post subject: SORT utility failing to sort in a correct order. |
|
|
Hi,
I am sorting a file containing a column with the following type of data. It is a fixed block file and this is the first column in the file.
Data is as follows:
..0-A8CD
..1-108V
..1-109V
..B-239
..Z-2SL
..N-245
Sorted file is as follows:
..B-239
..Z-2SL
..N-245
..0-A8CD
..1-108V
..1-109V
Could anyone please let me know the reason for this. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Mon Feb 09, 2004 3:24 pm Post subject: |
|
|
Sk,
I guess this is the continuation of the other topic where you had a problem with matching files. Btw are you able to fix the error ? You are eager to get an answer, but you don't show the same eagerness to post a feedback. posting a feedback helps in future searches if any one is dealing with the same problem.
One more thing please post the questions in the appropriate forum. The questions involving sort should be posted in "utilities" forum. I am moving this question to the utilities forum.
I remember that you are sorting the data as a character data. But if you look at the data the first 2 bytes are not displayable which makes me suspect that the data is either BINARY or COMP-3. so sorting this data as character data will not yield correct results.
open the input dataset in either browse mode or update mode
Type HEX ON at the command prompt
If the data is comp-3 you will find something like this
i.e the 2 bytes have a value of 1 in packed decimal format
If the data is comp you will find something like this
i.e the 2 bytes have a value of 1 in binary format
In that case you need to sort on the numeric portion seperately.
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
Frank Yaeger Sort Forum Moderator

Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Mon Feb 09, 2004 4:07 pm Post subject: |
|
|
Note that you can also use a DFSORT job to see what the data looks like in hex, e.g.
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTREC FIELDS=(1,2,HEX)
/*
|
As Kolusu says, depending on what the data looks like, you may need to use PD or BI format to sort it correctly. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort |
|
Back to top |
|
 |
|
|