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

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

SAS Training: Just a Click Away

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

Browse our catalog!

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