|
The presentation that PROC MEANS directs to the output window
can be generated to an ascii file by using PROC PRINTTO. It is
then a matter of reading the ascii file and parsing the records
to determine where the actual data begin and end. I submitted
the following code and obtained the desired results.
/* Route output to an ascii file */
proc printto print="c:\temp\sumstats.lst";
run;
/* Request statistics employing PROC MEANS */
options formchar='-';
proc means data=test2 nmiss n min max;
var _numeric_;
run;
/* Reset output to the default location */
proc printto;
run;
/* Parse the ascii file employing the following steps */
data sumstats;
length vname $ 32 line $ 200;
infile "c:\temp\sumstats.lst" length=linelen end=lastrec;
input _tmp $char1. @;
input @1 line $varying200. linelen;
if left(line)=:"-----" then do until(lastrec);
input _tmp $char1. @;
input @1 line2 $varying200. linelen @;
if left(line2)^=:"-----" then do;
input @1 vname nmiss n min max;
output;
end;
end;
keep vname nmiss n min max;
run;
/* Print the data set which contains the summary statistics */
proc print data=sumstats;
run;
That we cannot get the statistics in a vertical file directly
is a real pain in the patootie.
Dale
---------------------------------------
Dale McLerran
Fred Hutchinson Cancer Research Center
mailto: dmclerra@NO_SPAMfhcrc.org
Ph: (206) 667-2926
Fax: (206) 667-5977
---------------------------------------
--- On Wed, 7/21/10, Ya Huang <ya.huang@AMYLIN.COM> wrote:
> From: Ya Huang <ya.huang@AMYLIN.COM>
> Subject: Re: summary statistics of all variables
> To: SAS-L@LISTSERV.UGA.EDU
> Date: Wednesday, July 21, 2010, 12:02 PM
> Mike,
>
> "The only issue is that the data set is as linear as any
> made-for-TV movie."
> that is exactly why _null_, another Mike and me are trying
> to avoid.
> We all trying to work out a solution that a vertical
> dataset can be
> created without doing many other steps, such as transpose
> etc.
>
> Ya
|