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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.