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.
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.