Joined: 18 Apr 2006 Posts: 1 Topics: 1 Location: London UK
Posted: Wed Oct 03, 2007 8:15 am Post subject: Problem with TBSORT
I'm using TBSORT to, well, sort a list of entries comprising a code and a name. I'm toggling between code and name order and it all looks OK except that when sorting in name order I'm getting what at first looks OK, but scrolling down shows names not in sequence at all. I am retrieving the names from a DB2 table using something we have called REXXSQL, which gets data on to REXX compund variable, and I am using the DB2 UPPER() function to store a name field to sort on (I'm displaying on the panel the original mixed-case name). I have two versions of the name, a 30 character one and a 50 character on. The longer one sorts OK but the shorter one is the problem.
The sorting is achieved by this code:
if order = 'fundid' then
do
order = 'name'
if nametyp = 'SHORT' then
ADDRESS ISPEXEC "TBSORT" fundtab "FIELDS(TFUNDSNU)"
else
ADDRESS ISPEXEC "TBSORT" fundtab "FIELDS(TFUNDLNU)"
end
else
do
order = 'fundid'
ADDRESS ISPEXEC "TBSORT" fundtab "FIELDS(TFUNDID)"
end
return
where fundtab contains the ISPF table name. TFUNDSNU, TFUNDLNU are the shorter and longer names, respectively. TFUNDID is the code.
Joined: 12 Feb 2003 Posts: 358 Topics: 4 Location: Israel
Posted: Thu Oct 25, 2007 1:12 am Post subject:
Although not mandatory, you can try adding sort field type designator (probably 'C'), so the service should look like "ADDRESS ISPEXEC "TBSORT" fundtab "FIELDS(TFUNDSNU,C,A)"
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum