BookmarkSubscribeRSS Feed
vishalrajpoot3
Obsidian | Level 7

 

Hi There-

 

Please help to understand when I am sorting the data by below code and using the new created data set abc123 with by keyword on sorted variables, why SAS is showing error ''BY variables are not properly sorted on data set WORK.ABC1234"

 

Also how can I use variable actual with by keyword in data step ?

 

proc sort data=sashelp.prdsal2 (keep=country actual) out=abc1234;
by country descending actual;
run;

 

data abc;
set abc1234;
by country actual;
run;

 

 

1 REPLY 1
RW9
Diamond | Level 26 RW9
Diamond | Level 26

There is a word missing in your second by statement which appears in the first by statement...

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

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
  • 1 reply
  • 408 views
  • 0 likes
  • 2 in conversation