You'll need macro logic. The easiest is to pipe it to a table and then check if the table is empty. If so, don't do anything and if it has records you can then print it using PROC PRINT.
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!