BookmarkSubscribeRSS Feed
hdg
Obsidian | Level 7 hdg
Obsidian | Level 7

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!

1 REPLY 1
ballardw
Super User

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.


hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 959 views
  • 0 likes
  • 2 in conversation