Help using Base SAS procedures

sorting rows

Reply
Frequent Contributor
Frequent Contributor
Posts: 79

sorting rows

Hello everyone,

I have the following dataset

    dateNAME OF FORMERabc
3/31/2014weight0.325350.129620.1317
3/31/2014active-0.284150.021460.01334
4/30/2014weight0.32690.132790.13384
4/30/2014active-0.281470.023710.01418

I would like to sort the rows based on max date in the above table and the  name = active. In this case all rows will be sorted based on row 4:

for example the resulting data set looks like below.

This is just a small example of 3 columns but I could have more.

    dateNAME OF FORMERacb
3/31/2014weight0.325350.13170.12962
3/31/2014active-0.284150.013340.02146
4/30/2014weight0.32690.133840.13279
4/30/2014active-0.281470.014180.02371

Any help is appreciated many Thanks!

Grand Advisor
Posts: 10,025

Re: sorting rows

Doesn't look like a sort at this point just a column reorder. There are several threads in the forum about reordering data columns in a data set.


Ask a Question
Discussion stats
  • 1 reply
  • 129 views
  • 0 likes
  • 2 in conversation