LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (June 2008, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 9 Jun 2008 15:47:28 +0000
Reply-To:   iw1junk@COMCAST.NET
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Ian Whitlock <iw1junk@COMCAST.NET>
Subject:   Re: Bizarre sort problem
Comments:   cc: Sekhar <ckalisetty@GMAIL.COM>

Summary: Sort doesn't sort a sorted file. #iw-value=1

Sekhar,

Here is a hint at the problem.

1 data w (sortedby = obs) ; 2 do obs = 10 to 1 by -1 ; 3 x = ranuni ( 43365 ) ; 4 output ; 5 end ; 6 run ;

NOTE: The data set WORK.W has 10 observations and 2 variables. NOTE: DATA statement used (Total process time): real time 1.12 seconds cpu time 0.22 seconds

7 8 proc sort data = w ; 9 by obs ; 10 run ;

NOTE: Input data set is already sorted, no sorting done. NOTE: PROCEDURE SORT used (Total process time): real time 0.18 seconds cpu time 0.04 seconds

11 12 data _null_ ; 13 set w ; 14 by obs ; 15 run ;

ERROR: BY variables are not properly sorted on data set WORK.W. obs=10 x=0.9018403342 FIRST.obs=1 LAST.obs=1 _ERROR_=1 _N_=1 NOTE: The SAS System stopped processing this step because of errors. NOTE: There were 2 observations read from the data set WORK.W. NOTE: DATA statement used (Total process time): real time 0.21 seconds cpu time 0.05 seconds

This was run on a PC.

Exactly how your problem arose will depend on the history of how PROF was created. You might also take a look at the characteristics of the BY variable in both data sets.

Ian Whitlock =============

Date: Mon, 9 Jun 2008 07:50:39 -0700 Reply-To: Sekhar <ckalisetty@GMAIL.COM> Sender: "SAS(r) Discussion" From: Sekhar <ckalisetty@GMAIL.COM> Organization: http://groups.google.com Subject: Re: Bizarre sort problem Comments: To: sas-l Content-Type: text/plain; charset=ISO-8859-1

On Jun 9, 10:48 am, Sekhar <ckalise...@gmail.com> wrote: > I am constantly getting the same error message in SAS when this > piece of code ran successfully last week. Is this something to do > > Here is the log. > > 50 proc sort data=prof;by var1;run; > > NOTE: Input data set is already sorted, no sorting done. > NOTE: PROCEDURE SORT used (Total process time): > real time 0.01 seconds > cpu time 0.00 seconds > > 51 > 52 data calls; > 53 merge calls(in=in1) prof(in=in2); > 54 by var1; > 55 if in1; > 56 run; > > ERROR: BY variables are not properly sorted on data set WORK.PROF. > On further analysis I found som eunexplained "0" in the prof > dataset. I have no idea where they are coming from?

> Forgot to mention that we are running sas 9.1.3 on Unix


Back to: Top of message | Previous page | Main SAS-L page