Date: Fri, 10 May 2002 11:14:03 -0700
Reply-To: Cassell.David@EPAMAIL.EPA.GOV
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "David L. Cassell" <Cassell.David@EPAMAIL.EPA.GOV>
Subject: Re: A quick question: How to rearrange the position of variables
(columns) in an existing dataset
Content-type: text/plain; charset=us-ascii
Mike Rhoads <RHOADSM1@WESTAT.COM> wrote [in small part]:
> Yes, SAS will "work" regardless of the order in which the variables
are
> stored, just as it will "work" with crummy variable names, no variable
> labels, inconsistently indented code, and so forth. Having your
variables
> in a reasonable order is just one more way to make your projects and
> datasets easier to understand and to maintain.
Nice exposition! I am only quoting the part I want to discuss.
I am also eliding Ian Whitlock's excellent discussion [as always],
except to mention his point that sometimes users want to be able
to use the list form something--otherthing .
I posed the question "Why does the original poster want to do this?"
because so often what we on the list see is *not* a good use, as
mentioned
by our two Westat experts above, but an inefficient use. I see people
trying to get the variables re-arranged so that they can do things like
these:
* produce output in a PROC instead of specifying the order using a
VAR statement, for example producing output using PROC PRINT
* get FSBROWSE [or FSLIST] to put the variables in a desired order,
instead of telling FSBROWSE how to present the data [Peter Crawford
has written about this, and his posts are worth looking up]
For a lot of the posters who ask this question, I am concerned that
we are giving them the wrong help. Do they need better guidance about
structuring their data, or better guidance about using SAS features,
instead of a quick fix using RETAIN and perhaps a data step view? We
are seldom in a position to tell.
David
--
David Cassell, CSC
Cassell.David@epa.gov
Senior computing specialist
mathematical statistician