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 2001, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 17 Apr 2001 18:08:49 -0400
Reply-To:   Edward Heaton <HEATONE@WESTAT.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Edward Heaton <HEATONE@WESTAT.COM>
Subject:   Re: 'notsorted' option
Comments:   To: "Anthony.Kilili@BMGDIRECT.COM" <Anthony.Kilili@BMGDIRECT.COM>
Content-Type:   text/plain; charset="iso-8859-1"

Anthony; The NOTSORTED option works only if your data is grouped. If it is grouped and simply not in the proper sorting order, your output should be just fine. If, however, your BY variables are not grouped you will get results as indicated by the following:

data test ; input a b ; cards4 ; 1 2 1 3 2 4 2 5 1 6 1 7 2 8 2 9 ;;;; Proc summary data=test ; Var b ; By a notSorted ; Output out= testOut sum= / autoName ; Run ; Proc print data=testOut ; Run ;

=========== Output ================ Obs a _TYPE_ _FREQ_ b_Sum

1 1 0 2 5 2 2 0 2 9 3 1 0 2 13 4 2 0 2 17

As you see, you get a separate listing for each group of each value of A.

Hope this helps, Ed

Edward Heaton, SAS Senior Statistical Systems Analyst, Westat (An Employee-Owned Research Corporation), 1550 Research Boulevard, Room 2018, Rockville, MD 20850-3195 Voice: (301) 610-4818 Fax: (301) 294-3992 mailto:EdwardHeaton@westat.com http://www.westat.com

-----Original Message----- From: Anthony Kilili [mailto:Anthony.Kilili@BMGDIRECT.COM] Sent: Tuesday, April 17, 2001 4:58 PM To: SAS-L@LISTSERV.UGA.EDU Subject: 'notsorted' option

I'm trying to figure out an efficient method (fastest) to summarize some huge datasets using proc summary. So far, I have tried the following: 1. proc sort; by x y; proc summary; by x y; 2. proc summary; by x y notsorted; 3. proc summary; class x y; *crashes due to memory problems*; 4. proc sort; by x y; proc summary; class x y; The winner so far is no. 2. What are some of the dangers (if any) of using the notsorted option. My goal here is to try and stay away from the proc sort.

any thoughts?

Anthony


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