in reply to Where am I going wrong with printing flatfile db records in alphabetical order?

Hmm. Any particular reason to only sort on the first 8 characters of the last name? Unless your names are really really long (and perhaps not even then) I don't think it will make a difference to your output if you sort on the entire last name. That way you can avoid the custom sort routine.

Some other minor nits to pick: