Date: Thu, 1 Oct 2009 09:58:40 -0500
Reply-To: "Data _null_;" <iebupdte@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Data _null_;" <iebupdte@GMAIL.COM>
Subject: Re: How to add a column with order(1,2,3...) like obs in print?
Content-Type: text/plain; charset=ISO-8859-1
To me the "best" method is to choose a tool that knows SAS, knows what
an SAS enumerated variable list is and how it should most logically be
ordered. That tool is PROC CONTENTS.
attrib q12P3R1 Q12P3R10 Q12P3r2 Q12P3R3 length=8;
proc contents order=ignorecase noprint out=names(keep=name);
proc sql noprint;
select name into :orderedList separated by ' ' from names;
%put NOTE: ORDEREDLIST=&orderedList;
On 10/1/09, demin <firstname.lastname@example.org> wrote:
> Because I did something and made the order of my table has been
> changed, so I would like to add a order column to keep the old order.
> How to add such column with order 1,2,3...?
> Actually the column is character type, like :
> Q12P3R10 ? shis should be placed on the last one, but
> ?Q12P3R10 should be placed on the last one, but by "proc sql select
> *... order by ..." till cannot get the order I want. how to solve
> this? thanks.