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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.