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.
Ready to join fellow brilliant minds for the SAS Hackathon?
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.