home *** CD-ROM | disk | FTP | other *** search
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
- Path: sparky!uunet!spool.mu.edu!uwm.edu!zaphod.mps.ohio-state.edu!howland.reston.ans.net!paladin.american.edu!auvm!COMPUSERVE.COM!76350.1604
- Message-ID: <930106225402_76350.1604_EHJ101-2@CompuServe.COM>
- Newsgroups: bit.listserv.sas-l
- Date: Wed, 6 Jan 1993 17:54:03 EST
- Reply-To: Andy Norton <76350.1604@COMPUSERVE.COM>
- Sender: "SAS(r) Discussion" <SAS-L@UGA.BITNET>
- From: Andy Norton <76350.1604@COMPUSERVE.COM>
- Subject: discard superfluous observations *HOW*?
- Comments: To: SAS-L <SAS-L@AWIIMC12.IMC.UNIVIE.AC.AT>
- Lines: 29
-
- ----------------------------------------------------------------------
- CONTENT: Response
- SUMMARY: Counting within groups
- REL/PLTF: 6.07.0304/CMS, 6.04/PC-DOS, beta 6.08/OS2
- E-ADDR: 76350.1604@compuserve.com
- NAME: Andy Norton
- ADDRESS: Trilogy Consulting, 5148 Lovers Lane, Kalamazoo MI 49002 USA
- PHONE: (616) 344-4100
- ----------------------------------------------------------------------
-
- Patrick Haggard asks
- > My question: can anyone suggest a way to discard the excess
- > observations in a SAS data step, and to number the remaining
- > observations 1...n for each condition.
-
- proc sort;
- by COND;
- run;
-
- data REDUCED;
- set;
- by COND;
- if first.COND then
- COUNT=0;
- COUNT+1;
- if COUNT <= &N;
- run;
-
- Where &N represents the desired number of observations in each cell.
-