Posted By

webonomic on 02/04/09


variables reorder

Versions (?)

Reorder Variables in SAS

 / Published in: SAS

Use the Retain Statement to reorder variables. No data is lost and the variable attributes are kept. Works for SAS 8.2 and up.

  1. data neworder_retain;
  2. retain Name Age Sex Weight Height;
  3. set sashelp.class;
  4. run;

Report this snippet  


RSS Icon Subscribe to comments
Posted By: webonomic on March 1, 2013

Perhaps a better example:

data have; input var1 var2 var3 var4; cards; 11 12 13 14 21 22 23 24 31 32 33 34 ; run;

data reordered; retain var4 var3 var2 var1; set have; run;

You need to login to post a comment.