home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / bit / listserv / sasl / 5496 < prev    next >
Encoding:
Text File  |  1992-12-31  |  2.3 KB  |  68 lines

  1. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!howland.reston.ans.net!paladin.american.edu!auvm!PITTVMS.BITNET!ADROSEN
  3. X-Envelope-to: SAS-L@OHSTVMA.BITNET
  4. X-VMS-To: @SASL IN%"uncsm1@unc.bitnet"
  5. X-VMS-Cc: ADROSEN
  6. Message-ID: <01GSZ306B5M88YCKVZ@vms.cis.pitt.edu>
  7. Newsgroups: bit.listserv.sas-l
  8. Date:         Thu, 31 Dec 1992 17:47:00 EST
  9. Reply-To:     "Allan D. Rosen (412)624-0418" <ADROSEN@PITTVMS.BITNET>
  10. Sender:       "SAS(r) Discussion" <SAS-L@UGA.BITNET>
  11. From:         "Allan D. Rosen (412)624-0418" <ADROSEN@PITTVMS.BITNET>
  12. Subject:      Re: Data Manipulation Question
  13. Comments: To: uncsm1@UNC.BITNET
  14. Lines: 52
  15.  
  16. ----------------------------------------------------------------------
  17. CONTENT:  Response
  18. SUMMARY:  Question data manipulation needs to compute new variable
  19. REL/PLTF: 6.07 MVS/ESA
  20. E-ADDR:   adrosen@vms.cis.pitt.edu
  21. NAME:     Allan Rosen
  22. ADDR:     Epidemiology Data Center, Univ of Pittsburgh, PA
  23. ----------------------------------------------------------------------
  24.  
  25. The following will merge the data set together with itself and
  26. create all the necessary observations to complete the question
  27. further below:
  28.  
  29. proc sql;
  30. create table new as
  31. select data1.cocd, data1.pr80, data1.sic80, data2.entsic
  32. from data1(keep=cocd pr80 sic80) data1
  33.      data1(keep=cocd entsic   where=(entsic>.z)) data2
  34. where data1.cocd=data2.cocd
  35. order by data1.cocd, data1.sic80, data2.entsic;
  36. quit;
  37.  
  38. A short version of Sally Muller's original problem follows:
  39.  
  40.  BELOW IS PART OF THE DATA.
  41.  
  42. OBS    COCD      PR80     SIC80    ENTSIC
  43.  
  44.   1     A2     0.00085    2751      2761
  45. ...
  46.   3     A2     0.02359    3079      7372
  47.   4     A2     0.07601    3555         .
  48. ...
  49.  18     A2     0.00396    7699         .
  50.  19     A3     0.00039    0191      1213
  51. ...
  52.  30     A3     0.03732    2819      8911
  53.  31     A3     0.04738    2874         .
  54. ...
  55.  
  56.  I WANT TO DO THE FOLLOWING MANIPULATIONS ON IT:
  57.  
  58.    CREATE A VARIABLE CALLED 'D'.  COCD is the "by variable" and
  59.    he wants to compute D from an operation on SIC80 and ENTSIC.
  60.    The trick being he wants each SIC80 with each ENTSIC within
  61.    a particular COCD.  For example for the first COCD ('A2') he
  62.    wants to output 18*3=54   observations which will have the D
  63.    variable.  Similarly, for the second COCD ('A3') he needs
  64.    31*12=372 observations output.
  65.  
  66. Allan Rosen
  67. University of Pittsburgh
  68.