The SAS Output Delivery System and reporting techniques

How to suppress empty output from proc sql

Reply
Occasional Contributor JMS
Occasional Contributor
Posts: 8

How to suppress empty output from proc sql

The following code gives an empty result page:

ods listing close;                                              
ods html;                                                        
title 'report 1';
proc sql; select * from sashelp.class where age=99; run; quit;  
ods html close;                                                  
ods listing;       

How can I suppress the empty page when proc sql does not return a result?

 

Super User
Posts: 23,980

Re: How to suppress empty output from proc sql

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.

 

Example of conditional logic is here:

http://documentation.sas.com/?docsetId=mcrolref&docsetTarget=p011imau3tm4jen1us2a45cyenz9.htm&docset...

Ask a Question
Discussion stats
  • 1 reply
  • 81 views
  • 0 likes
  • 2 in conversation