I am trying to sort my data based on the number of appearances in descending order and then only printing the variables host and the fifth day of showing.
I keep getting the following error messages:
the order come before the variable name;
proc sort data=snl out=snl2;
by descending appearances ;
run;
You never reference NAME so I have a hard time seeing how that error message belongs to the code you're showing.
Can you post the full code, the full log and the output from PROC CONTENTS.
Date variables sort the same as any other variables. I'm not seeing how a data has any effect on your code at this point.
the order come before the variable name;
proc sort data=snl out=snl2;
by descending appearances ;
run;
You also need to put descending BEFORE the variable you want to sort descending.
That's what's likely generating your error.
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!
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.