I'm trying the following sql code and it gave me this warning message when I limit the outputs to 3
Is this warning ok??
You have told the code to finish at 3 observations regardless of how many it would normally of done, the warning confirms that this is what has happened so that there is no misconceptions further along. Why do you need to artificially limit the obs to 3 anyway? Why can you not logically arrive at 3 records?
You have told the code to finish at 3 observations regardless of how many it would normally of done, the warning confirms that this is what has happened so that there is no misconceptions further along. Why do you need to artificially limit the obs to 3 anyway? Why can you not logically arrive at 3 records?
Move the limitation from SQL to a dataset option:
proc sql;
create table &Queries.3 (obs=3) as
select category, count(*) as cat
from &Queries.1
where status="Open"
group by 1
order by 2 desc;
quit;
just change @Kurt_Bremser code to
proc sql outobs=3;
create table class as
select * from sashelp.class
order by height desc;
that's what I did but it gave me warning
That was just a shot into the blue.
For production purposes (no warnings allowed), I'd run the SQL without outobs, and then filter the first three entries in a follow-up step.
Alternatively you can also use proc means to do this:
http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a001016379.htm
proc sql nowarn outobs=3;
This is the most efficient way to limit the output.
proc sql will stop processing data as soon as the outobs= condition is met.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.