Date: Thu, 13 May 2004 16:52:16 -0400
Reply-To: Venky Chakravarthy <venky.chakravarthy@PFIZER.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Venky Chakravarthy <venky.chakravarthy@PFIZER.COM>
Subject: Re: Clarification on ‘by' statement
Content-Type: text/plain; charset=ISO-8859-1
Earlier, I had suggested a solution without checking whether I could
reproduce the problem. Try as I might, I couldn't replicate what you have
observed.
There were some issues with dataset header corruption in Version 8.1
(probably RLS related). There were hotfixes available even then, but these
issues were fixed in 8.2 anyway and you should not be seeing them. Ask your
SAS rep to contact tech support.
None of the below resulted in any errors.
options validvarname = v7 ;
libname myv8 "c:\c_data\junk\v8" ;
data test1 test2 myv8.test3 myv8.test4 ;
do id = 1 to 3 ;
output ;
end ;
run ;
data result1 ;
set test1 ;
by id ;
run ;
data result2 ;
set test2 ;
by id ;
run ;
proc sort data = test1 ;
by id ;
run ;
proc sort data = myv8.test3 ;
by id ;
run ;
libname myv6 v612 "c:\c_data\junk\v612" ;
data myv6.test1 ;
set test1 ;
run ;
data myv6.test2 ;
set test2 ;
run ;
data myv6.test3 ;
set myv8.test3 ;
run ;
data myv6.test4 ;
set myv8.test4 ;
run ;
data result3 ;
set myv6.test1 ;
by id ;
run ;
data result4 ;
set myv6.test2 ;
by id ;
run ;
data result5 ;
set myv6.test3 ;
by id ;
run ;
data result6 ;
set myv6.test4 ;
by id ;
run ;
Venky Chakravarthy
On Wed, 12 May 2004 14:37:40 -0700, kevin <kevin20142000@YAHOO.COM> wrote:
>Hello all,
>
>I have a program below, dataset one is not sorted, when I run the
>program under sas ver8.2 on pc, no error massage come out.
>
>libname tx 'M:\ver8\data';
>libname tin 'M:\ver8\data';
>libname library 'M:\ver8\lib';
>options fmtsearch=(library.txca);
>
>
>Data two;
> Set tx.one;
> By id;
>Run;
>
>But, if I run the program using sas ver612 datasets under sas ver8.2
>on pc, the following error showed on log.
>
> ‘ERROR: BY variables are not properly sorted on data set tx.one'
>
>libname tx v612 'M:\ver6\data';
>libname tin v612 'M:\ver6\data';
>libname library 'M:\ver\lib';
>options fmtsearch=(library.txca);
>
>
>Data two;
> Set tx.one;
> By id;
>Run;
>
>I understand that we need to do ‘proc sort' before we can use ‘by'
>statement in dataset. Why the error massage did not show. Any advice?
>
>Thank you in advance,
>
>Kevin