|Date: ||Tue, 12 Sep 2006 19:29:10 +0000|
|Reply-To: ||toby dunn <tobydunn@HOTMAIL.COM>|
|Sender: ||"SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>|
|From: ||toby dunn <tobydunn@HOTMAIL.COM>|
|Subject: ||Re: Sorting column order|
|Content-Type: ||text/plain; format=flowed|
Disregard that last post I missed something. In the other hand if you have
named lists like that you should be beat with in an inch of your life and
When everything is coming at you all at once, your in the wrong lane.
A truly happy person is someone who can smile and enjoy the scenery on a
From: "data _null_;" <datanull@GMAIL.COM>
Reply-To: "data _null_;" <datanull@GMAIL.COM>
Subject: Re: Sorting column order
Date: Tue, 12 Sep 2006 15:12:36 -0400
To get the desired order where there are "number range names" a1-a10
don't we need to rely on the PROC CONTENTS definition of alphabetical
order. Consider the following.
retain BBB1-BBB20 AAA CCC AAA1-AAA10 BBB 0;
proc contents noprint out=work.contents(keep=name);
proc sql noprint;
select name into :alphaNameList SEPARATED ','
Create Table work.alphaNames As
%put NOTE: alphaNameList=&alphaNameList;
proc contents data=work.alphaNames varnum;
On 9/12/06, toby dunn <firstname.lastname@example.org> wrote:
>Two things come to mind:
>SCL which I wont bother writing code for as the SCL Nut will surely show up
>and expound upon the greatness of SCL and the how the rest of SAS sucks.
>Lets see if he actually writes something usefull and creates the code for
>The second thing is simple and will irritate the afore mentioned SCL Nut (
>which makes it all the more fun for me ):
>Proc SQL NoPrint ;
>Select Name Into : Vars Separated By ' , '
> Where LibName = 'WORK'
> And MemName = 'AAA'
> Order By Name ;
>Create Table Need As
> From Have ;
>When everything is coming at you all at once, your in the wrong lane.
>A truly happy person is someone who can smile and enjoy the scenery on a
>Subject: Sorting column order
>Date: Tue, 12 Sep 2006 11:12:50 -0700
>I have an issue that has been stumping me.
>Does anyone know of an automated way to sort column orders for output?
>I have fields with names:
>AAA BBB DDD CCC
>That's the variable order in my SAS dataset. I want the columns to be
>sorted alphabetically though. (I have about 800 columns that can change
>names, so manual hardcording isn't possible.)
>Does this question make sense?
>Thanks for any help!