From: nirad.p on
Dear folks,
I want to change order of variable in SAS dataset.Like

Previous:
Name Dept Roll no

After:
Roll no name Dept

sholb be done.How can i do this.

Thank you.

From: toby dunn on
Use a retain statement before your set statement.



Toby Dunn

To sensible men, every day is a day of reckoning. ~John W. Gardner

The important thing is this: To be able at any moment to sacrifice that
which we are for what we could become. ~Charles DuBois

Don't get your knickers in a knot. Nothing is solved and it just makes you
walk funny. ~Kathryn Carpenter






From: "nirad.p(a)gmail.com" <nirad.p(a)GMAIL.COM>
Reply-To: "nirad.p(a)gmail.com" <nirad.p(a)GMAIL.COM>
To: SAS-L(a)LISTSERV.UGA.EDU
Subject: How to change order of variable in SAS dataset
Date: Fri, 26 Jan 2007 11:56:07 -0800

Dear folks,
I want to change order of variable in SAS dataset.Like

Previous:
Name Dept Roll no

After:
Roll no name Dept

sholb be done.How can i do this.

Thank you.

_________________________________________________________________
Search for grocery stores. Find gratitude. Turn a simple search into
something more.
http://click4thecause.live.com/search/charity/default.aspx?source=hmemtagline_gratitude&FORM=WLMTAG
From: kenneth_m_lin on
Use RETAIN statement to specify the field order in DATA STEP before SET
statement.

<nirad.p(a)gmail.com> wrote in message
news:1169841366.900207.204460(a)q2g2000cwa.googlegroups.com...
> Dear folks,
> I want to change order of variable in SAS dataset.Like
>
> Previous:
> Name Dept Roll no
>
> After:
> Roll no name Dept
>
> sholb be done.How can i do this.
>
> Thank you.
>


From: toby dunn on
Yeah I think you didnt read the part where the Retain statement had to come
before the set statement:


data final_five ;
retain state name COUNTY fippz ;
set five ;
Run ;



Toby Dunn

To sensible men, every day is a day of reckoning. ~John W. Gardner

The important thing is this: To be able at any moment to sacrifice that
which we are for what we could become. ~Charles DuBois

Don't get your knickers in a knot. Nothing is solved and it just makes you
walk funny. ~Kathryn Carpenter






From: "Nirad Pachchigar" <nirad.p(a)gmail.com>
To: "toby dunn" <tobydunn(a)hotmail.com>
Subject: Re: How to change order of variable in SAS dataset
Date: Fri, 26 Jan 2007 14:15:30 -0600

Dera tody ,
Previous : county name state was the order of columns.now i want state name
county fippz as order.so i write this statement,but it did not work,still
same order comes.
*

data* final_five; set five;retain state *name* COUNTY fippz ;*run*;



On 1/26/07, toby dunn <tobydunn(a)hotmail.com> wrote:
>
>Nirad you will have to run the data set through another data step to
>change
>the order of the variables. Thsu you can use a retain statment.
>
>
>
>Toby Dunn
>
>To sensible men, every day is a day of reckoning. ~John W. Gardner
>
>The important thing is this: To be able at any moment to sacrifice that
>which we are for what we could become. ~Charles DuBois
>
>Don't get your knickers in a knot. Nothing is solved and it just makes you
>walk funny. ~Kathryn Carpenter
>
>
>
>
>
>
>From: "Nirad Pachchigar" <nirad.p(a)gmail.com>
>To: "toby dunn" <tobydunn(a)hotmail.com>
>Subject: Re: How to change order of variable in SAS dataset
>Date: Fri, 26 Jan 2007 14:08:59 -0600
>
>Dear tony,
> I have a dataset in working directory,before using Export
>statement i have to change the order of the columns in the dataset.i can
>not
>use retain statement here.
>
>
>On 1/26/07, toby dunn <tobydunn(a)hotmail.com> wrote:
> >
> >Use a retain statement before your set statement.
> >
> >
> >
> >Toby Dunn
> >
> >To sensible men, every day is a day of reckoning. ~John W. Gardner
> >
> >The important thing is this: To be able at any moment to sacrifice that
> >which we are for what we could become. ~Charles DuBois
> >
> >Don't get your knickers in a knot. Nothing is solved and it just makes
>you
> >walk funny. ~Kathryn Carpenter
> >
> >
> >
> >
> >
> >
> >From: "nirad.p(a)gmail.com" <nirad.p(a)GMAIL.COM>
> >Reply-To: "nirad.p(a)gmail.com" <nirad.p(a)GMAIL.COM>
> >To: SAS-L(a)LISTSERV.UGA.EDU
> >Subject: How to change order of variable in SAS dataset
> >Date: Fri, 26 Jan 2007 11:56:07 -0800
> >
> >Dear folks,
> > I want to change order of variable in SAS dataset.Like
> >
> >Previous:
> >Name Dept Roll no
> >
> >After:
> >Roll no name Dept
> >
> >sholb be done.How can i do this.
> >
> >Thank you.
> >
> >_________________________________________________________________
> >Search for grocery stores. Find gratitude. Turn a simple search into
> >something more.
> >
> >
>http://click4thecause.live.com/search/charity/default.aspx?source=hmemtagline_gratitude&FORM=WLMTAG
> >
> >
>
>
>--
>Sincerely,
>Nirad Pachchigar
>503 cherry street Apt # 137
>TX,USA 77840
>(979) 204-4572
>nirad.p(a)gmail.com
>
>_________________________________________________________________
>FREE online classifieds from Windows Live Expo � buy and sell with people
>you know
>
>http://clk.atdmt.com/MSN/go/msnnkwex0010000001msn/direct/01/?href=http://expo.live.com?s_cid=Hotmail_tagline_12/06
>
>


--
Sincerely,
Nirad Pachchigar
503 cherry street Apt # 137
TX,USA 77840
(979) 204-4572
nirad.p(a)gmail.com

_________________________________________________________________
From predictions to trailers, check out the MSN Entertainment Guide to the
Academy Awards�
http://movies.msn.com/movies/oscars2007/?icid=ncoscartagline1
From: David L Cassell on
nirad.p(a)GMAIL.COM wrote:
>
>Dear folks,
> I want to change order of variable in SAS dataset.Like
>
>Previous:
>Name Dept Roll no
>
>After:
>Roll no name Dept
>
>sholb be done.How can i do this.
>
>Thank you.

Despite all the fine suggestions you received, I am going to
say that you don't want to do this.

Unless you are ordering the data for output to an Excel spreadsheet,
there is little reason to do this. Data display procs have their
own ways of specifying the apparent data order, and you ought
to use those instead.

HTH,
David
--
David L. Cassell
mathematical statistician
Design Pathways
3115 NW Norwood Pl.
Corvallis OR 97330

_________________________________________________________________
FREE online classifieds from Windows Live Expo � buy and sell with people
you know
http://clk.atdmt.com/MSN/go/msnnkwex0010000001msn/direct/01/?href=http://expo.live.com?s_cid=Hotmail_tagline_12/06