The first.variable/last.variable IMHO ranks up there with transposing as features that show off the power of SAS for data preparation. Another source for details on this is the documentation section "By-Group Processing in SAS Programs".