How AS 400 sorting data?


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
Old 6 Days Ago
How AS 400 sorting data?

Hi Gurus,
I have a requests to sort data based on AS 400 sorting order. below is example: the data is sorted by ascending order. could anybody explain how AS 400 sort data?

Code:
IMM00007
07918607
1242
423

# 2  
Old 5 Days Ago
It may just be a simple numeric sort, similar to how Unix will too if you ask it to. Letters are seen as sorted before numbers, however zero (a zero value, even if 75 characters long) will be before them all. A shorter number of leading zeros is sorted before longer ones, of the same value.

You might illustrate it with this:-
Code:
printf "a
1
b
000000000000000000000000000000000000000
g
3
c
09
0"|sort -n


I hope that this helps,
Robin
# 4  
Old 5 Days Ago
"collating sequence" is the key!
While most language (locale) settings in Unix are based on the ASCII sequence (numbers before characters), IBM seems to stick to the EBCDIC sequence (numbers after characters).
Maybe it is tunable? Search for "as400 how to set collating sequence"
These 2 Users Gave Thanks to MadeInGermany For This Post:
drl (5 Days Ago) rbatte1 (5 Days Ago)
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
LDIF Data sorting by timestamp atlowi Shell Programming and Scripting 2 01-07-2015 12:51 PM
Sorting data - awk or sort or both SkySmart Shell Programming and Scripting 3 08-19-2014 06:08 AM
Sorting the data with date arindam guha Shell Programming and Scripting 5 06-11-2013 01:05 PM
Sorting the Data ckaramsetty Shell Programming and Scripting 1 08-05-2011 12:03 AM
Help with Data Sorting pawannoel UNIX for Dummies Questions & Answers 11 03-15-2011 06:19 PM
Extract data from an AS/400 tape mindmachine AIX 4 11-26-2010 11:09 AM
Sorting data visuelz UNIX for Dummies Questions & Answers 7 03-25-2010 02:17 PM
Help with Data Sorting Command 793589 UNIX for Dummies Questions & Answers 7 10-01-2009 08:12 AM
Sorting data from a to z cosmologist UNIX for Dummies Questions & Answers 2 08-12-2009 04:01 PM
PERL data - sorting eagercyber Shell Programming and Scripting 3 06-20-2008 03:02 AM
sorting data from who by IP raidzero UNIX for Dummies Questions & Answers 11 06-19-2008 09:56 AM
apache ErrorDocument 400 /cgi-bin/400.cgi afadaghi Solaris 0 06-16-2008 11:09 PM
sorting data using array in ksh ali560045 Shell Programming and Scripting 4 12-04-2007 03:26 AM
Sorting blocks of data alfredo123 Shell Programming and Scripting 8 07-05-2007 10:53 AM