Hi, Rick,

Kudos for yet another practical and to the point post. I've used SCAN before, but needed a quick refresher -- and your post here fits the bill perfectly.

I now have a macro that parses Libnames out of a master SAS program based on the first word being 'LIBNAME' and the second being the name of the Libname I'm trying to allocate. A simple %Master_Lib(name) now allocates files for us based on a "single source of truth" -- and only those needed instead of a list longer than War and Peace as we were doing by %INCLUDEing the master SAS program.

My thanks,

Jim