LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (April 1996, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 10 Apr 1996 16:56:49 EDT
Reply-To:   whitloi1@WESTATPO.WESTAT.COM
Sender:   "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:   Ian Whitlock <whitloi1@WESTATPO.WESTAT.COM>
Subject:   Re[2]: SASTip: Multiple output statements with SUMMARY
Comments:   To: TWB2%Rates%FAR@GO50.COMP.PGE.COM

Subject: SASTip: Multiple output statements with SUMMARY Summary: PROC MEANS and SUMMARY are intertwined. Respondent: Ian Whitlock <whitloi1@westat.com>

Phil Mason <wood-st@cityscape.co.uk> offered:

> In PROC SUMMARY you can have multiple OUTPUT statements. This > enables a variety of stats to be calculated and written to a range of > datasets. > > ===> Example (SAS log) > > > 257 proc summary data=sasuser.houses ; > 258 class style bedrooms ; > 259 var sqfeet price ; > 260 output out=price(keep=style bedrooms price) sum= ; > 261 output out=average mean= ; > 262 output out=top(where=(_type_=3)) ; > 263 run ; > > NOTE: The data set WORK.PRICE has 20 observations and 3 variables. > NOTE: The data set WORK.AVERAGE has 20 observations and 6 variables. > NOTE: The data set WORK.TOP has 55 observations and 7 variables. NOTE: > The PROCEDURE SUMMARY used 0.33 seconds.

And Tim Berhill <TWB2%Rates%FAR@GO50.COMP.PGE.COM> asked for comments on why TOP restricted to _TYPE_=3 has more records than the other sets?

One must remember that there used to be two PROCS - an old MEANS which many old users refused to give up and a SUMMARY redesigned for efficient use. After many years of trying to get users to switch, SI melded the two procedures into one set of code with two parsers when version 6 was introduced.

Both PROCs now give the SUMMARY type of data set when statistics are asked for on the OUTPUT statement. But when no statistics are asked for in PROC MEANS, you get the old MEANS type of data set which by default gives 5 lines of statistics for each class level. PROC SUMMARY will not do this if there is no VAR statement present. But when there is a VAR statement present and no statistics are asked for it will switch to the old MEANS data set. Since there are 11 class levels with _TYPE_ = 3 the output for TOP will have 55 records.

Ian Whitlock


Back to: Top of message | Previous page | Main SAS-L page