Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Sorting a hexadecimal field.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
kbmkris

Active User


Joined: 24 Jun 2006
Posts: 101

PostPosted: Mon Jun 04, 2007 4:24 pm    Post subject: Sorting a hexadecimal field.
Reply with quote

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
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Jun 04, 2007 4:37 pm    Post subject:
Reply with quote

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
View user's profile Send private message
kbmkris

Active User


Joined: 24 Jun 2006
Posts: 101

PostPosted: Mon Jun 04, 2007 4:42 pm    Post subject:
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Jun 04, 2007 4:49 pm    Post subject:
Reply with quote

A2
AF

B8
BJ

C5
CA

So for all 10 columns you want numerics to sort ahead of alphabetics?
Back to top
View user's profile Send private message
kbmkris

Active User


Joined: 24 Jun 2006
Posts: 101

PostPosted: Mon Jun 04, 2007 4:50 pm    Post subject:
Reply with quote

yes
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Jun 04, 2007 4:58 pm    Post subject:
Reply with quote

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
View user's profile Send private message
kbmkris

Active User


Joined: 24 Jun 2006
Posts: 101

PostPosted: Mon Jun 04, 2007 5:09 pm    Post subject:
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Jun 04, 2007 5:20 pm    Post subject:
Reply with quote

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
View user's profile Send private message
kbmkris

Active User


Joined: 24 Jun 2006
Posts: 101

PostPosted: Mon Jun 04, 2007 5:32 pm    Post subject:
Reply with quote

ok. Thanks William.

Thanks,
Bala
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Jun 04, 2007 7:16 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Efficient sorting chandracdac DFSORT/ICETOOL 5 Sat Oct 22, 2016 3:23 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us