Check nobs for the dataset beforehand (save to a macro variable), and wrap the dataset conditionally in a macro. Use that macro in place of the dataset name in the set statement.
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!