home *** CD-ROM | disk | FTP | other *** search
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!howland.reston.ans.net!paladin.american.edu!auvm!PITTVMS.BITNET!ADROSEN
- X-Envelope-to: SAS-L@OHSTVMA.BITNET
- X-VMS-To: @SASL IN%"uncsm1@unc.bitnet"
- X-VMS-Cc: ADROSEN
- Message-ID: <01GSZ306B5M88YCKVZ@vms.cis.pitt.edu>
- Newsgroups: bit.listserv.sas-l
- Date: Thu, 31 Dec 1992 17:47:00 EST
- Reply-To: "Allan D. Rosen (412)624-0418" <ADROSEN@PITTVMS.BITNET>
- Sender: "SAS(r) Discussion" <SAS-L@UGA.BITNET>
- From: "Allan D. Rosen (412)624-0418" <ADROSEN@PITTVMS.BITNET>
- Subject: Re: Data Manipulation Question
- Comments: To: uncsm1@UNC.BITNET
- Lines: 52
-
- ----------------------------------------------------------------------
- CONTENT: Response
- SUMMARY: Question data manipulation needs to compute new variable
- REL/PLTF: 6.07 MVS/ESA
- E-ADDR: adrosen@vms.cis.pitt.edu
- NAME: Allan Rosen
- ADDR: Epidemiology Data Center, Univ of Pittsburgh, PA
- ----------------------------------------------------------------------
-
- The following will merge the data set together with itself and
- create all the necessary observations to complete the question
- further below:
-
- proc sql;
- create table new as
- select data1.cocd, data1.pr80, data1.sic80, data2.entsic
- from data1(keep=cocd pr80 sic80) data1
- data1(keep=cocd entsic where=(entsic>.z)) data2
- where data1.cocd=data2.cocd
- order by data1.cocd, data1.sic80, data2.entsic;
- quit;
-
- A short version of Sally Muller's original problem follows:
-
- BELOW IS PART OF THE DATA.
-
- OBS COCD PR80 SIC80 ENTSIC
-
- 1 A2 0.00085 2751 2761
- ...
- 3 A2 0.02359 3079 7372
- 4 A2 0.07601 3555 .
- ...
- 18 A2 0.00396 7699 .
- 19 A3 0.00039 0191 1213
- ...
- 30 A3 0.03732 2819 8911
- 31 A3 0.04738 2874 .
- ...
-
- I WANT TO DO THE FOLLOWING MANIPULATIONS ON IT:
-
- CREATE A VARIABLE CALLED 'D'. COCD is the "by variable" and
- he wants to compute D from an operation on SIC80 and ENTSIC.
- The trick being he wants each SIC80 with each ENTSIC within
- a particular COCD. For example for the first COCD ('A2') he
- wants to output 18*3=54 observations which will have the D
- variable. Similarly, for the second COCD ('A3') he needs
- 31*12=372 observations output.
-
- Allan Rosen
- University of Pittsburgh
-