With SAS, keeping only variables whose names start with a particular character string is a piece-of-cake - just use the handy-dandy colon notation.
And if you subscribe to the SAS Samples RSS Feed, you'll also know how to Keep only the variables in a data set that end in a particular character or characters.
Uncomfortable with the C-like SCL functions that this example employs?
No problem-o.
Check out this timely SAS-L thread, where folks check in with SQL-based solutions!








1. Ted,
This is a lot easier, IMO, using v9 regular expressions. Heck, since SAS has introduced regex, there's a lot less reason to use any of the traditional string functions.
My $ 0.01,
Alan
Posted at 1:13AM on Jul 31st 2006 by Alan Churchill