Date: Tue, 12 Sep 2006 12:05:18 -0700
Reply-To: Stig Eide <stig.eide@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Stig Eide <stig.eide@GMAIL.COM>
Organization: http://groups.google.com
Subject: Re: Sorting column order
In-Reply-To: <1158084770.256481.314140@d34g2000cwd.googlegroups.com>
Content-Type: text/plain; charset="iso-8859-1"
kbehm1@gmail.com wrote:
> I have an issue that has been stumping me.
>
> Does anyone know of an automated way to sort column orders for output?
>
Hi.
This should work. I am not aware of a method that does not need to
rewrite the table.
Stig Eide
data test;
bbbb='sadd';aaaa='fdfd';dddd='dsvxczvx';cccc='zsczc';
run;
data cols (keep=name);
set sashelp.vcolumn (where=(libname='WORK' and memname='TEST'));
run;
proc sort data=cols;
by name;
run;
proc sql noprint;
select name into :names separated by ' '
from cols;
quit;
%let names=&names;
data test;
attrib &names TRANSCODE=YES;
set test;
run;
|