home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / bit / listserv / sasl / 5760 < prev    next >
Encoding:
Internet Message Format  |  1993-01-27  |  1.7 KB

  1. Path: sparky!uunet!stanford.edu!bu.edu!olivea!spool.mu.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!howland.reston.ans.net!paladin.american.edu!auvm!LOBBY.TI.COM!RSNYDER
  2. From: rsnyder@LOBBY.TI.COM (R. Snyder)
  3. Newsgroups: bit.listserv.sas-l
  4. Subject: Re: Reordering variables in a SAS dataset
  5. Message-ID: <199301261727.AA20265@lobby.ti.com>
  6. Date: 26 Jan 93 17:27:57 GMT
  7. Sender: "SAS(r) Discussion" <SAS-L@UGA.BITNET>
  8. Reply-To: "R. Snyder" <rsnyder@LOBBY.TI.COM>
  9. Lines: 41
  10. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  11. X-Mailer: ELM [version 2.2 PL16]
  12. Comments: To: TED@SERVER.SASW.NCSU.EDU
  13. Comments: cc: sas-l@uga.cc.uga.edu
  14. In-Reply-To:  <199301261545.AA16963@lobby.ti.com>; from "Ted Greenstein" at Jan
  15.               26, 93 10:22 am
  16.  
  17. SUBJECT:   Reordering data set variables
  18. SUMMARY:   SQL
  19. REL/PLTF:  6.08/Windows
  20. E-ADDR:    rsnyder@lobby.ti.com
  21. NAME:      Bob Snyder
  22. COMPANY:   Texas Instruments, Sherman, TX
  23. PHONE:     (903) 868-5799
  24. FAX:       (903) 868-7240
  25. >
  26. > Is there an easy way to reorder the variables in a SAS dataset (this
  27. > is under 6.08 for Windows)?  I know that I can (a) change the order
  28. > in which the data are read from the raw data file initially, and (b)
  29. > write the variables out using a PUT statement, then read them back in
  30. > the desired order.  But isn't there some easier way?
  31. >
  32. <stuff deleted>
  33. >
  34. > Theodore N. Greenstein
  35. > 307 1911 Building
  36. > Department of Sociology and Anthropology
  37. > North Carolina State University
  38. > Raleigh, NC 27695-8107
  39. >
  40. > Voice: (919) 515-3114  FAX: (919) 515-2610
  41. > Email: ted_greenstein@ncsu.edu
  42. >
  43. Hi,
  44.  
  45. Since you are using 6.08 you can use PROC SQL to easily perform this task.
  46.  
  47. proc sql;
  48.  
  49. create TABLE | VIEW new as
  50.  
  51.   select var1, var2, ..., varN
  52.     from old;
  53.  
  54. quit;
  55.  
  56. Regards,
  57. Bob
  58.