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.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.