[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: Sorting
Ben,
That is a difficult situation since last name may not be the last word in
the field. Two suggestions for a full-proof method:
1. Join the NAME table which has last name as a separate field then sort
OR
2. SUBSTR the name field into up to 4 fields (FIRST MIDDLE LAST EXT). I am
assuming is the max. Then if your have only TWO not null field, the second one
is the last name. If you have FOUR, the third field is the last name. If you
have middle name as X., then the rest is easy. Therefore if you have THREE
not null fields, check if middle exists.
OK. Now you know which field is the last name. SQR "WRITE" this last name field
to a file with other needed data (GPA....etc). SORT the file via VMS SORT
or other operating system functions (CALL SYSTEM USING.....). The result will
be a sorted listing of your table. READ the data from the file for further
SQR processing.
Good Luck
Nick Moscaritolo
Sr. Programmer/Analyst II
Bentley College
Waltham, MA 02154