View previous topic :: View next topic
|
Author |
Message |
kbmkris
Active User
Joined: 24 Jun 2006 Posts: 101
|
|
|
|
hi,
I have a hexadecimal field in my input file. I want to sort that file in that field in acending order. Can anyone help me in doing this? What type of format i have to use? I have only SYNCSORT in my shop.
I tried to sort the file with the format F, but it doesn't come correctly.
AF
A0
A0
A2
BJ
BM
B8
CA
CH
C1
C4
C4
C5
C5
Thanks,
Bala |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
As far as it goes, there is no such thing as a hexadecimal field.
That said, "format F"?
Treat the two columns as character and it will sort just fine.
What order do you want vs what order did you get?
What do your sort control parms look like? |
|
Back to top |
|
|
kbmkris
Active User
Joined: 24 Jun 2006 Posts: 101
|
|
|
|
hi,
My sort card looks like this.
Code: |
SORT FIELDS=(21,10,CH,A) |
I want the output like the following
A0
A0
A2
AF
B8
BJ
BM
C1
C4
C4
C5
C5
CA
CH
Thanks,
Bala |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
A2
AF
B8
BJ
C5
CA
So for all 10 columns you want numerics to sort ahead of alphabetics? |
|
Back to top |
|
|
kbmkris
Active User
Joined: 24 Jun 2006 Posts: 101
|
|
|
|
yes |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Again, did you look in the manual?
Chapter 2. SyncSort Control Statements
Sample ALTSEQ Control Statements
ALTSEQ CODE=(F0B7,F1B8,F2B9,F3BA,F4BB,F5BC,F6BD,F7BE,F8BF,F9C0)
Figure 7. Sample ALTSEQ Control Statement
This sample ALTSEQ control statement shows that the numbers 0 through 9 are to collate
before the uppercase alphabet. |
|
Back to top |
|
|
kbmkris
Active User
Joined: 24 Jun 2006 Posts: 101
|
|
|
|
Hi William,
Yes I have the manual and I looked into that. But the thing is how can i find the corresponding hex code for alphabets and digits? And i haven't ever used the ALTSEQ, a little bit hesistance as i am not aware of it. Could you help me how to find the hex code for alphabets and digits?
Thanks for your valuable information.
Thanks,
Bala |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
The posted example is exactly what you want:
"numbers 0 through 9 are to collate before the uppercase alphabet".
Just include it and you will get what you want. |
|
Back to top |
|
|
kbmkris
Active User
Joined: 24 Jun 2006 Posts: 101
|
|
|
|
ok. Thanks William.
Thanks,
Bala |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
While on the pc and unix systems, it is "normal" for numbers to sort ahead of letters. This is not true on the mainframe.
While you can force the sequence you want, you may have problems using it in your application programs. Anything that compares one value to another will compare the numbers as a higher value than the letters eventhought they are presented "out of order". Any "keys" in vsam or database will use the standard collating sequence, not the "ALTSEQ".
If the only reason for this sequence to is to download, you may be ok, but if the ALTSEQed output is to be used on the mainframe, there may be problems. |
|
Back to top |
|
|
|