LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (June 1996, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 21 Jun 1996 17:43:50 GMT
Reply-To:     Laura Aaronson <aaronsonlm@ZEN.COM>
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         Laura Aaronson <aaronsonlm@ZEN.COM>
Organization: Zeneca Inc.
Subject:      Re: Help on re-ordering variables in a dataset.

Ron Carpenter <rcarpen@hookup.net> wrote: >gkeeler@psych.mc.duke.edu wrote: >> >> I need to re-order the variables in a dataset, in order to import them correctly >> details snipped >> Does anyone know of an easier way to re-order the variables in a SAS dataset, > >To re-order the variables, you define them before you read them in a SET >statement. > >DATA TEST; > LENGTH A $ 8 B $ 4 C $ 8 X 4 Y Z 8; > SET TEST; >RUN; >

This is an ideal case for using RETAIN instead of LENGTH. Simple, no unwanted side-effects of RETAIN... Saves time, because you don't have to specify type or length:

DATA TEST; RETAIN A B C X Y Z; SET TEST; RUN;

Laura M. Aaronson (aaronsonlm@zen.com) Someday I'll have a snappy .SIG file...


Back to: Top of message | Previous page | Main SAS-L page