saravanakumar
Member
Hi Everybody,
I am stuck up with the below issue, can anyone please help me out in this regard. I have provided a code snippet which is easily understandable (...do agree not an optimized one. Sorry), i need to know how the sorting works in Progress 4GL. [Client has raised the same query. V need a ping point answer... Plzzz Friendsssss]
I need to know the following things;
1) How does the BY work (logic behind the BY).
2) Is it a Character by Character sorting ?(...if so the result set that i get is wrong for the below code)
3) Is it an ASCII character set sorting or any other?
Result Set: (ASCENDING)
pragadeesh
11111
12345
1Pragadeesh
1pragadeesh
1pragadeesh
1PRAGAdeesh
2Pragadeesh
2pragaDEESH
Praga deesh3
pragadeesh
Pragadeesh
Pragadeesh3
Pragadeesh3
PRAGAdeesh3
Result Set 1: (DESCENDING)
PRAGAdeesh3
Pragadeesh3
Pragadeesh3
Pragadeesh
pragadeesh
Praga deesh3
2pragaDEESH
2Pragadeesh
1pragadeesh
1pragadeesh
1PRAGAdeesh
1Pragadeesh
12345
11111
pragadeesh
Here at least the ascending order should be the exact reverse of the descending order but it is not so. WHY???
Thanks in advance. :dizzy:
I am stuck up with the below issue, can anyone please help me out in this regard. I have provided a code snippet which is easily understandable (...do agree not an optimized one. Sorry), i need to know how the sorting works in Progress 4GL. [Client has raised the same query. V need a ping point answer... Plzzz Friendsssss]
I need to know the following things;
1) How does the BY work (logic behind the BY).
2) Is it a Character by Character sorting ?(...if so the result set that i get is wrong for the below code)
3) Is it an ASCII character set sorting or any other?
DEFINE TEMP-TABLE ttname
FIELD ttname1 AS CHAR.
CREATE ttname.
ASSIGN ttname1 = "Pragadeesh".
CREATE ttname.
ASSIGN ttname1 = "1Pragadeesh".
CREATE ttname.
ASSIGN ttname1 = "2Pragadeesh".
CREATE ttname.
ASSIGN ttname1 = "12345".
CREATE ttname.
ASSIGN ttname1 = "Pragadeesh3".
CREATE ttname.
ASSIGN ttname1 = "11111".
CREATE ttname.
ASSIGN ttname1 = "pragadeesh".
CREATE ttname.
ASSIGN ttname1 = "1PRAGAdeesh".
CREATE ttname.
ASSIGN ttname1 = "1pragadeesh".
CREATE ttname.
ASSIGN ttname1 = "1pragadeesh".
CREATE ttname.
ASSIGN ttname1 = "Pragadeesh3".
CREATE ttname.
ASSIGN ttname1 = "PRAGAdeesh3".
CREATE ttname.
ASSIGN ttname1 = "Praga deesh3".
CREATE ttname.
ASSIGN ttname1 = "2pragaDEESH".
CREATE ttname.
ASSIGN ttname1 = " pragadeesh".
FOR EACH ttname NO-LOCK BY ttname1:
DISP ttname.ttname1 FORMAT "X(15)".
END.
Result Set: (ASCENDING)
pragadeesh
11111
12345
1Pragadeesh
1pragadeesh
1pragadeesh
1PRAGAdeesh
2Pragadeesh
2pragaDEESH
Praga deesh3
pragadeesh
Pragadeesh
Pragadeesh3
Pragadeesh3
PRAGAdeesh3
Result Set 1: (DESCENDING)
PRAGAdeesh3
Pragadeesh3
Pragadeesh3
Pragadeesh
pragadeesh
Praga deesh3
2pragaDEESH
2Pragadeesh
1pragadeesh
1pragadeesh
1PRAGAdeesh
1Pragadeesh
12345
11111
pragadeesh
Here at least the ascending order should be the exact reverse of the descending order but it is not so. WHY???
Thanks in advance. :dizzy: