BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Thuto
Calcite | Level 5

I'm getting an error saying "ERROR: Data set WORK.MYCLASS is not sorted in ascending sequence. The current BY group has Sex = M and the next BY group has Sex = F ". What am I supposed to do? I don't understand the error message.

data myclass;

set sashelp.class; where Age between 13 and 16;

run;

proc sort data=myclass out=myclass2;

by sex;

run;

proc freq data=myclass;

by sex;

tables age;

run;

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

Please note the correction in red

 

proc freq data=myclass2;

 

MYCLASS is not sorted by sex. MYCLASS2 is sorted by sex.

--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26

Please note the correction in red

 

proc freq data=myclass2;

 

MYCLASS is not sorted by sex. MYCLASS2 is sorted by sex.

--
Paige Miller
Thuto
Calcite | Level 5
Thanks a lot

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 712 views
  • 0 likes
  • 2 in conversation