turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- Base SAS Programming
- /
- two level sort

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

04-18-2013 07:52 PM

Hi,

I have a table containing a few different experiments A, B, C...that where output Y has been measured. I would like to sort Y in ascending order but not for the whole table, only within each experiment A, B, C...

and get a table like this:

EXP Measurement Y

A YA1

A YA2

A YA3

B YB1

B YB2

B YB3

....

(where YA1<YA3<YA3 but YB1 could be anything either bigger or smaller than YA3)

Thank you for any advice!

Oh, and I'd like to include this into a script I have.

N.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Nico_jmp

04-19-2013 09:01 AM

Proc Sort data = test;

by measurement_Y exp;

run;

I think it is simple or i am not to understand your requirement...

-Urvish

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Nico_jmp

04-19-2013 09:02 AM

Perhaps Im missing something but a a standard proc sort data=your table; by exp measurementY; run; should do what you seek.

EJ

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Nico_jmp

04-19-2013 09:24 AM

As Eric pointed out, there is fairly straightforward solution. However, if we understand you wrong, and what you mean happen to be: 1. EXP stay the order as is 2. Sort measurement_Y with EXP. Then we will probably need some Hash(). If you do mean the latter, please let us know.

Haikuo

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Nico_jmp

04-19-2013 07:53 PM

Hi,

Thanks for your help.

I figured out how to do what I needed, was pretty straight forward as you said - Simply needed to have two arguments : By( :column1, :column2 )... Here's what I put in my script:

Data Table( "dt" ) << Sort(

By( :Testing Comments , :MOR ),

Order( Ascending, Ascending ));

Thanks,

N

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Nico_jmp

04-19-2013 08:58 PM

That looks like JMP code to me.

You may be better posting these types of question in a JMP forum instead.