inobs and outobs showing the same no. of rows in the table. so what is the difference between them?
in some cases you may want to split observations - e.g write out per date in a range of dates.
in other case you may want to filter your input and select output according to some rules.
in both cases inobs will differ from outobs.
Hi @priyankachauhan, @Shmuel is very kind enough to explain how it works. I am sure, you may or may not understand a lot of concepts if you are a beginner. I found it very hard when i was a beginner 5 years ago. I suggest you to get a copy of this amazing book which has everything that you want and more-
In the simplest cases they are the same. But as soon as you complicate things they are not.
They do what it sounds like it does, one controls how many records are read, InOBS) and one controls how many records are output. Since the number of records read obviously affects the outcome they are very different.
Here's an example of the exact same code and INOBS=2 and OUTOBS=2 in each run. Check the output.
title 'OutObs demo';
proc sql outobs=2;
select age, count(*)
from sashelp.class
group by age
order by age desc;
;
quit;
title 'InObs demo';
proc sql inobs=5;
select age, count(*)
from sashelp.class
group by age
order by age desc;
;
quit;
Results:
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.