Rick, the code you presented looks like a perfect fit for a SAS package. :-) How about building one?