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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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