05-16-2012 06:27 PM
If I only want 10 observations to output, where in the code would I place that. If I do not do observations I end up with 4996 pages.
ODS RTF FILE='C:\documents and settings\tmill29\my documents\my sas files\9.2\readmin\readm2.RTF';
PROC FREQ DATA = ReAdm.CHI ORDER = DATA; BY COMPARISON;
TABLES SVRTY_LVL_CD*WHO*ADMISSION/CMH EXPECTED OUTEXPECT;
OUTPUT OUT = ReAdm.Final OR CMH;
ODS RTF CLOSE;
05-17-2012 05:34 AM
With SAS procedures, I believe you can only control the number of observations being read in (using OBS= with the option statement or as a dataset option), not the number being output. The only exception I know of is PROC SQL where you can use the OUTOBS= option.
If you want to restrict the number to test the code, then set OBS= as below.
PROC FREQ DATA = ReAdm.CHI (OBS=100)
05-17-2012 09:11 AM
Keith, that's 100 observations input, which doesn't seem to answer the question.
I consider the original question unclear, as there is no relationship that I know of between observations and pages, yet you speak of both as if they are interchangeable.
I think you mean to say that the output data set to have 10 observations, in which case you want
OUTPUT OUT = readm.final(obs=10) or cmh;
05-17-2012 09:43 AM
The OBS= dataset option can only be used against the input dataset, it has no effect when applied against an output dataset. I stated that I don't think it is possible to achieve the desired result, what @tmcrouse didn't say was why there is a requirement to have only 10 output observations. I merely stated that if data checking was the purpose then this could be achieved by limiting the number of input observations.
05-19-2012 02:34 PM
Sounds like you want the printed output to only have a subset of the data.
Why not use the NOPRINT (or ODS CLOSE) and instead use proc freq to write a dataset and then print the dataset with an OBS= dataset option.