Problem Note 66181: The error message "BY variables are not properly sorted…" occurs after running a DATA step that includes both a WHERE clause and the SINGLE=YES option
In SAS® Cloud Analytic Services (CAS), running a DATA step that both contains a WHERE clause and has the SINGLE=YES option set produces the following error:
ERROR: BY variables are not properly sorted on data set CAS-table-name.
The following example code reproduces this issue:
data casuser.test;
set sashelp.class;
run;
proc sort data=casuser.test nodupkey;
by name;
run;
data casuser.new / single=yes;
set casuser.test(where=(weight<1000));
by name;
run;
Log output (with errors) that is similar to the following is then produced:
88 data casuser.new / single=yes;
89 set casuser.test(where=(weight<1000));
90 by name;
91 run;
NOTE: Running DATA step in Cloud Analytic Services.
ERROR: BY variables are not properly sorted on data set CASUSER.TEST.
Name=Mary Sex=F Age=15 Height=66.5 Weight=112 FIRST.Name=1 LAST.Name=1 _ERROR_=1 _N_=3
ERROR: The action stopped due to errors.
NOTE: The SAS System stopped processing this step because of errors.
You can circumvent this problem by using a subsetting IF statement in place of the WHERE clause:
data casuser.new / single=yes;
set casuser.test;
if weight<1000;
by name;
run;
Click the Hot Fix tab in this note for a link to instructions about accessing and applying the software update.
Operating System and Release Information
SAS System | SAS Viya | Linux for x64 | 3.5 | 3.5 | Viya | Viya |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
Running a DATA step in CAS that contains both a WHERE clause and the SINGLE=YES option can produce the following error.
ERROR: BY variables are not properly sorted on data set
.
Type: | Problem Note |
Priority: | high |
Date Modified: | 2020-06-30 08:01:32 |
Date Created: | 2020-06-22 13:44:24 |