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

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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
  • 717 views
  • 1 like
  • 2 in conversation