Given an arbitrary file (not a .sas7bdat file), open the file using FILENAME statement/functions and read the header. Certain patterns in the header are a strong indicator the file may be a SAS data set.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!