Date: Mon, 21 May 2007 18:08:46 +0000
Reply-To: toby dunn <tobydunn@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: toby dunn <tobydunn@HOTMAIL.COM>
Subject: Re: SQL ODS prevent title when select grabs no row
In-Reply-To: <56l4i.5$GA.187576@news.sisna.com>
Content-Type: text/plain; format=flowed
Richard ,
Hmmmm well one could play off of how SQL executes code and Macro Execution
time:
%Macro Title( NObs = ) ;
%If ( &NObs > 0 ) %Then %Do ;
title "Data entry errors may have occurred";
%End ;
%Mend Title ;
proc sql;
select * from
sashelp.class as A, sashelp.class as B
where A.name ne B.name
and abs(a.age-b.age) < 2
and abs(a.weight-b.weight) > 80
;
%Title( Nobs = &SqlObs )
quit;
Toby Dunn
On the other hand, you have different fingers. ~ LCG
The early bird may get the worm, but the second mouse gets the cheese in the
trap. ~ LCG
What happens if you get scared half to death, twice? ~ LCG
From: "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
Reply-To: "Richard A. DeVenezia" <rdevenezia@WILDBLUE.NET>
To: SAS-L@LISTSERV.UGA.EDU
Subject: SQL ODS prevent title when select grabs no row
Date: Mon, 21 May 2007 13:57:07 -0400
A SQL select statement (join) is used to report anomolous data. Sometimes
the select results in no rows.
Is there an easy way to keep SQL from outputting a title when there are no
rows ?
Example:
title "Data entry errors may have occurred";
proc sql;
select * from
sashelp.class as A, sashelp.class as B
where A.name ne B.name
and abs(a.age-b.age) < 2
and abs(a.weight-b.weight) > 80
;
quit;
--
Richard A. DeVenezia
_________________________________________________________________
More photos, more messages, more storage—get 2GB with Windows Live Hotmail.
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_2G_0507