Date: Thu, 13 Jul 2000 11:01:21 -0400
Reply-To: "Todt, Frederick R" <todt@BATTELLE.ORG>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Todt, Frederick R" <todt@BATTELLE.ORG>
Subject: Re: How to modify order of VARiables
Here's a tip I learned in a recent SAS course - to re-order the variables in
a data table, just use a RETAIN statement with the variables in the desired
order as the first statement in a data step. For example,
/* begin code */
data newtable;
retain num var1 var2 var3 var4 var5;
set oldtable;
run;
/* end code*/
Hope this helps!
Fred Todt
Columbus, OH
> -----Original Message-----
> From: jan-manuel.norais.caf.aubenas
> [SMTP:jan-manuel.norais.caf.aubenas@WANADOO.FR]
> Sent: Thursday, July 13, 2000 10:26 AM
> To: SAS-L@VM.MARIST.EDU
> Subject: How to modify order of VARiables
>
> How to modify order of variables in a data table?
> For example :
> from the old table : NUM VAR5 VAR2 VAR3
> VAR1 VAR4
> 1 001 5
> 2 3 1 4
> 2 002 5
> 2 3 1 4
> 3 003 5
> 2 3 1 4
>
> i would get a new table : NUM VAR1 VAR2 VAR3 VAR4
> VAR5
> 1 001 1
> 2 3 4 5
> 2 002 1
> 2 3 4 5
> 3 003 1
> 2 3 4 5
>
> Thanks
> --
> > \ I / <
> / ( @ @ ) \
> ------o00--(_)--00o---- Jan-Manuel Norais -------
> Conseiller du Directeur pour l'Action sociale
> Caisse d'Allocations Familiales d'AUBENAS
> 56 bd du Marichal Leclerc
> 07207 AUBENAS cedex
> jan-manuel.norais.caf.aubenas@wanadoo.fr
|