Date: Sun, 16 Feb 2003 09:52:00 -0500
Reply-To: lpogoda <lpogodajr292185@COMCAST.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: lpogoda <lpogodajr292185@COMCAST.NET>
Subject: Re: Re-ordering the positions of columns
John Whittington wrote in message
<5.1.0.14.2.20030216032716.030cf6e0@pop3.powernet.co.uk>...
>At 21:24 15/02/03 -0500, lpogoda wrote (in small part):
>
>>Only the first time I tried it under version 8, it didn't work.
>>.... it turned out that he was controlling the print order by
>>rewriting the dataset according to the variable order parameter, and doing
>>it in exactly the way you suggested at the top of this post, with a RETAIN
>>statement followed by a macro variable.
>>
>>And when we pulled the macro apart and ran things step by step manually,
>>we found that even though the macro variable was correctly valued, when
>>the dataset was rewritten this way, the variable order didn't change. And
>>so the listing that was produced showed variables in whatever order they
>>happened to occur in the dataset rather than in the order requested.
>
>I can but presume that something about the program was 'wrong' - perhaps
>the most likely (the most common mistake) being that the RETAIN statement
>was not put before the SET one - since it works fine for me. Try the
>following:
>
Perhaps I didn't emphasize it enough, but it's stated above, and I'll quote
it again: "doing it in exactly the way you suggested at the top of this
post, with a RETAIN statement followed by a macro variable".
It should go without saying, since in either version using a SET statement
as the first statement of a DATA step establishes the variable order, that
this was before the SET statement. In version 6, a RETAIN following a SET
doesn't reorder the variables any more than it does in version 8, and the
thing worked in version 6.
I won't be in the office again until Wednesday - I'll try to remember to
hunt down an example then.
Lou
|