As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at firstname.lastname@example.org and provide your corporate email address, company, and name.
Focus 101 sorting. Here is my code TABLE FILE CAR PRINT COUNTRY CAR MODEL BODYTYPE LENGTH BY LENGTH BY BODYTYPE END
This is a simple program, but on the seventh and eighth line, why does SEDAN appear before COUPE? 'C' comes before 'S'.
PAGE 1 LENGTH BODYTYPE COUNTRY CAR MODEL BODYTYPE LENGTH 163 SEDAN JAPAN DATSUN B210 2 DOOR AUTO SEDAN 163 163 COUPE ITALY ALFA ROMEO 2000 GT VELOCE COUPE 163 165 HARDTOP ENGLAND TRIUMPH TR7 HARDTOP 165 165 SEDAN JAPAN TOYOTA COROLLA 4 DOOR DIX AUTO SEDAN 165 170 ROADSTER ITALY ALFA ROMEO 2000 SPIDER VELOCE ROADSTER 170 176 SEDAN W GERMANY BMW 2002 2 DOOR SEDAN 176 W GERMANY BMW 2002 2 DOOR AUTO SEDAN 176 177 SEDAN ITALY ALFA ROMEO 2000 4 DOOR BERLINA SEDAN 177 177 COUPE ITALY MASERATI DORA 2 DOOR COUPE 177 182 SEDAN FRANCE PEUGEOT 504 4 DOOR SEDAN 182 187 SEDAN W GERMANY AUDI 100 LS 2 DOOR AUTO SEDAN 187This message has been edited. Last edited by: FP Mod Chuck,
First of all welcome to Focal Point, it is a great forum to get answers to your development questions...
The only thing I can figure is that the CAR database is hierarchical and the LENGTH field is in a child segment of the BODYTYPE field. When I changed your report to SEATS instead of LENGTH it sorted as you would expect and that field is in the same segment as BODYTYPE. If I used any of the other fields under the SPECS segment it does sort weird.
Anyone else have an explantion for this?
Thank you for using Focal Point!
Chuck Wolff - Focal Point Moderator WebFOCUS 7x and 8x, Windows, Linux All output Formats
Posts: 2128 | Location: Customer Support | Registered: April 12, 2005
Not sure that's it Chuck. Sorting worked just fine when I use FUEL_CAP, RPM, MPG, or BHP from the SPECS, but not for Length or Width. This is interesting behavior. Perhaps in the background length and width are indexed differently?
JC WebFOCUS Dev Studio / App Studio 8.2.01 Windows 7