BookmarkSubscribeRSS Feed
Justin9
Obsidian | Level 7

I've got a variable called 'band', which has three values: 

0-<2441

2449-<20001

200001-High

 

How can the 'band' variable be sorted (or resolve the error), as I'm running a proc surveyselect on my TEST dataset afterwards but have got the error message: "ERROR: Data set WORK.TEST is not sorted in ascending sequence. The current BY group has band=2449-<200001 and the next BY group has band=0-<2449"?

 

Current code:

proc sort data=test
                 out=final_checks;
         by band;
run;

 

1 REPLY 1
sbxkoenk
SAS Super FREQ

Hello,

 

Are you sure you use FINAL_CHECKS as input to your PROC SURVEYSELECT?

I think you are using TEST instead!

 

Koen

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

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 1 reply
  • 667 views
  • 1 like
  • 2 in conversation