home *** CD-ROM | disk | FTP | other *** search
- 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
- From: rsnyder@LOBBY.TI.COM (R. Snyder)
- Newsgroups: bit.listserv.sas-l
- Subject: Re: Reordering variables in a SAS dataset
- Message-ID: <199301261727.AA20265@lobby.ti.com>
- Date: 26 Jan 93 17:27:57 GMT
- Sender: "SAS(r) Discussion" <SAS-L@UGA.BITNET>
- Reply-To: "R. Snyder" <rsnyder@LOBBY.TI.COM>
- Lines: 41
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
- X-Mailer: ELM [version 2.2 PL16]
- Comments: To: TED@SERVER.SASW.NCSU.EDU
- Comments: cc: sas-l@uga.cc.uga.edu
- In-Reply-To: <199301261545.AA16963@lobby.ti.com>; from "Ted Greenstein" at Jan
- 26, 93 10:22 am
-
- SUBJECT: Reordering data set variables
- SUMMARY: SQL
- REL/PLTF: 6.08/Windows
- E-ADDR: rsnyder@lobby.ti.com
- NAME: Bob Snyder
- COMPANY: Texas Instruments, Sherman, TX
- PHONE: (903) 868-5799
- FAX: (903) 868-7240
- >
- > Is there an easy way to reorder the variables in a SAS dataset (this
- > is under 6.08 for Windows)? I know that I can (a) change the order
- > in which the data are read from the raw data file initially, and (b)
- > write the variables out using a PUT statement, then read them back in
- > the desired order. But isn't there some easier way?
- >
- <stuff deleted>
- >
- > Theodore N. Greenstein
- > 307 1911 Building
- > Department of Sociology and Anthropology
- > North Carolina State University
- > Raleigh, NC 27695-8107
- >
- > Voice: (919) 515-3114 FAX: (919) 515-2610
- > Email: ted_greenstein@ncsu.edu
- >
- Hi,
-
- Since you are using 6.08 you can use PROC SQL to easily perform this task.
-
- proc sql;
-
- create TABLE | VIEW new as
-
- select var1, var2, ..., varN
- from old;
-
- quit;
-
- Regards,
- Bob
-