|Date: ||Wed, 23 Mar 2005 15:56:06 -0500|
|Reply-To: ||Nishant Dholakia <firstname.lastname@example.org>|
|Sender: ||"SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>|
|From: ||Nishant Dholakia <nishant.dholakia@GMAIL.COM>|
|Subject: ||Re: sort.|
|Content-Type: ||text/plain; charset=ISO-8859-1|
I will definitely try that out. However I just want to be sure because
vi has a value of S and B and S should be placed before B. Is that the
sorting order of EBCDIC.
I have not had a chance to try my own solution of implementing a
special missing value and creating a sorting variable.
what do you think about it.
On Tue, 22 Mar 2005 10:42:39 -0800, Jim Simmons
> Dennis is correct that the EBCDIC collating sequence will correctly sort your data. You can invoke this sequence in non-EBCDIC environments with the following:
> PROC SORT EBCDIC;
> BY P VI;
> That seems to me to be the easiest way assuming you already have the missing numeric value for DO in obs 5 represented by a "."(SAS missing numeric value).
> Jim Simmons
> Dennis Diskin <diskin@SNET.NET> wrote:
> Unless you are running on an EBCDIC system (IBM
> mainframe), in which case you can just sort:
> My suggestion:
> sort normally on p and vi and then:
> data ordered;
> set sorted(where=(vi eq 'b'))
> sorted(where=(bi ne 'b'));
> by p;
> Dennis Diskin
> --- Nishant Dholakia
> > Hi,
> > I have to create data set in which data is supposed
> > to be like this
> > p vi do
> > 1 b 20
> > 1 3 40
> > 1 4 40
> > 2 b 20
> > 2 3
> > basically the sorting has to be done by p and vi.
> > However the issue I am
> > facing is that vi is character values. using input i
> > can convert the values
> > to numeric and sort however there is one value (b)
> > that can not be
> > manipulated this way. the value b should always be
> > the first for any p
> > value.
> > b is already present so I can not use the logic if
> > first.p then vi =b;
> > Is there some way to do this.
> > thanks
Nishant H. Dholakia
607 262 0860
"its your attitude not your aptitude that determines your altitude"