× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Here's what I see -

The first sort is done according to the actual hex value of the character in AZ - notice that it is in order by the hex numeric value - numbers come before letters - the order is 0123456789ABCDEF.

Now the second sort is done according to the character representation of the hex value - so letters come before numbers, in the normal EBCDIC order. Letters before numbers.

In embedded SQL you can set the sort sequence - set option srtseq=*JOB or *HEX or *JOB or *JOBRUN or *LANGIDSHR or *LANGIDUNQ - you can even name a sort table. This is an option you set at the top of the source code and applies to everything in a single code unit - so if you need both case-sensitive and case-insensitive options, you have to do it with 2 modules - a great case for ILE!!

Eh?
Vern

David FOXWELL wrote:
Hi,

With this request : SELECT AZ , hex( AZ ) FROM az ORDER BY AZ

I'm getting
AZ HEX ( AZ )
ê 52
à 7C
a 81
c 83
e 85
é C0
è D0
ç E0

If I use ORDER BY hex(AZ)
I get
AZ HEX ( AZ )
é C0
è D0
ç E0
ê 52
à 7C
a 81
c 83
e 85

Can anyone tell me how the sorting works?
Thanks

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.