Date: Mon, 15 Aug 2005 21:32:55 -0400
Reply-To: Lou <lpogodajr292185@COMCAST.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Lou <lpogodajr292185@COMCAST.NET>
Subject: Re: Arranging variables
"Vladislav" <vladislav.moltchanov@ktl.fi> wrote in message
news:ddll4d$93l$1@oxygen.ktl.fi...
> Dorfman, Paul wrote:
> >
> > The simple fact in question is that if any variables are included in
> > RETAIN coded as the first instruction after the DATA statement, NOTHING
> > coded in the step thereafter can change their order.
> >
>
> You are simply right.
> I have been using Retain for retaining the values. For this pruposes
> retain statement have been located somewhere in the body of the data
> step, where usually the variables in question were generated.
>
> For me the idea of reodering the variables in the data set sounds very
> strange, I can't see any reason for this.
As a programmer, I'd agree - there's no operational point. For the most
part, a program doesn't care what order variables occur in a dataset.
However, often we're in the position of delivering datasets to be used by
non-programming types - they'll examine them in the SAS viewer, or copy the
contents to a spreadsheet. These people want and expect to see the
variables in a certain order - usually the variables comprising the data set
key first, then the "data" variables in some logical sequence, and if they
receive periodic updates, they want it in the same order every time.
Usually, these people want the dataset sorted some specific way as well.
As a programmer, I have to admit, it's somewhat easier to make sure
nothing's been left out if a specific order is specified.
|