Date: Thu, 26 Jan 2006 23:34:51 -0500
Reply-To: "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Subject: Re: Formating in the proc means results
On Thu, 26 Jan 2006 13:32:06 -0800, ulagappan@GMAIL.COM wrote:
>Is there a simple way to format the proc means output
>
>proc means data = sashelp.air;
Strange, I don't have SASHELP.AIR in my install (9.1.3 SP3). So I'll use
data air;
do d = 0 to today(); e = -d; output; end;
format d e date9.;
run;
>run;
>
>
>I get the statistical results of date variable in SAS date format.
>I have the round about ways to do it.
>Output the means with format.
>However there is a problem. In my case I have 20 variables.
>So the out table is quite long.
>When I transpose, the format is agian lost.
>So I am doing one variable at a time, instead of all 20.
>
>Any help will be appreciated.
>ulag
TABULATE gives you a lot more control. Consider:
options nocenter FORMCHAR="|----|+|---+=|-/\<>*";
proc tabulate data=air;
var d e;
table f=date9.*(mean std*f=4. min max),
d e;
run;
I've deliberately crossed two format specs, since the standard deviation
should not get a date format. A log warning results, but I get what I want:
--------------------------------------------
| | d | e |
|----------------------+---------+---------|
|Mean |13JAN1983|18DEC1936|
|----------------------+---------+---------|
|Std | 4858| 4858|
|----------------------+---------+---------|
|Min |01JAN1960|06DEC1913|
|----------------------+---------+---------|
|Max |26JAN2006|01JAN1960|
--------------------------------------------
To avoid the log warning, I could get verbose and hang a format on each of
the 4 stat keywords.