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 has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

SAS Training: Just a Click Away

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

Browse our catalog!

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