|
Michael:
As an alternative to other, more global solutions, take a look at this
simple method:
data noPrint;
message='nada';
run;
data test;
x=12;
run;
proc sql;
create table print as
select * from test
where x<=12
;
quit;
proc sql noprint;
select count(*) into :__n from print
;
quit;
%macro testPrint(___n);
%if (&___n ne 0) %then %do; proc print data=print;
run; quit;
%end;
%else %do; proc print data=noprint noobs;
run; quit;
%end;
%mend testPrint;
%testPrint(&__n)
**;
Since the SELECT INTO clause instantiates the macrovariable __n, the test of
the macrovariable value follows creation of the dataset named 'print'.
Sig
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Michael
F. Murphy
Sent: Monday, October 18, 2004 2:26 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Create Output Identifying No Records Found
Hi SAS-L-ers,
We have a program that creates a SAS dataset, called "COSTS", that contains
data from different sources for one health record number. This is printed to
a LST file.
If no records are found, no LST file is created. If this is the case, we
want the user to know that no records were found when they go to the LST
file. Otherwise the LST file contains the relevant cost data.
What SAS code will do this?
Thanks.
Mike
|