| Date: | Thu, 2 Jul 2009 07:09:05 -0400 |
| Reply-To: | "Nallapeta, Kiran K (GE Money)" <kiran.nallapeta@GE.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | "Nallapeta, Kiran K (GE Money)" <kiran.nallapeta@GE.COM> |
| Subject: | Re: "BY variables are not properly sorted" error message on
sorted data set |
|
| In-Reply-To: | A<100FCDB28E638D4B903CB7D2056E43C7027D41EB@USFCH-MAIL1.lewin.com> |
| Content-Type: | text/plain; charset="US-ASCII" |
Just to make sure that the dataset used in the set statement is sorted,
can you explicitly specify output dataset in your sort procedure and
retry running your code?
Example:
proc sort data=cr.num06 out=cr.num06a; by rpt_rec_num; run;
data num ;
set cr.num06a;
by rpt_rec_num ;
DummyRecNum+1;
run;
Thanks,
Kiran
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Kirby, Ted
Sent: Thursday, July 02, 2009 3:10 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: "BY variables are not properly sorted" error message on sorted
data set
I have created a dataset, called "num06" and submitted the following
code:
proc sort data=cr.num06; by rpt_rec_num; run;
data num ;
set cr.num06;
by rpt_rec_num ;
DummyRecNum+1;
run;
and I get the following error:
ERROR: BY variables are not properly sorted on data set
CR.NUM06.
rpt_rec_num=225759 ws=H010000 line=01100 col=0700 item=-43668
FIRST.rpt_rec_num=0
LAST.rpt_rec_num=1 DummyRecNum=7005469 _ERROR_=1 _N_=7005470
NOTE: The SAS System stopped processing this step because of
errors.
NOTE: There were 7005471 observations read from the data set
CR.NUM06.
WARNING: The data set WORK.NUM may be incomplete. When this step
was stopped there were
7005469 observations and 6 variables.
WARNING: Data set WORK.NUM was not replaced because this step
was stopped.
NOTE: DATA statement used (Total process time):
real time 20.75 seconds
cpu time 3.76 seconds
When I try to recreate the dataset and rerun the code, I still get the
same error, but not necessarily on the same observation (_n_). I have
examined the "offending" observation(s) and those around it, but can
find nothing that I could determine would cause this problem. (My real
program was much more complicated, but the error happened even on this
little program.)
Any ideas?
Thanks,
--Ted Kirby,
Consultant,
The Lewin Group, Inc.
3130 Faivew Park Drive, Suite 800
Falls Church, VA 22042
e-mail: ted.kirby@lewin.com <mailto:ted.kirby@lewin.com>
P: (703)269-5507
F: (703)269-5501
************* IMPORTANT - PLEASE READ ********************
This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity to
which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.
|