In reply to Bob.

Bob, have you seen the Query Template feature in SAS Enterprise Guide 5.1? That might serve your purpose. Design the query once, and then reuse with different data as needed. Here is a link to a comprehensive paper from SAS Global Forum 2012, "Finding Your Inner Query".