/* Using automatic variables */ /* on the extensive NFL players data set */ data nflplayers; FILENAME webpage URL 'http://people.stat.sc.edu/hitchcock/nfl_season_data.txt'; infile webpage DLM=',' DSD; INPUT idcode $ lastname :$20. firstname :$20. year team $ position $ G GS COMP ATT PassYD PassTD INT rush rushYD rushTD rec recYD recTD; run; /* Just interested in rushing totals for 1998 */ data rushing1998; set nflplayers (DROP=G GS COMP ATT PassYD PassTD INT rush rushTD rec recYD recTD); if year=1998; run; /* Sort by rushing yards */ proc sort data=rushing1998; BY descending rushYD; run; data rushing1998; set rushing1998; RushRank = _N_; drop idcode; run; proc print data=rushing1998; title '1998 rushing yards for NFL players'; run; PROC SORT data=rushing1998; BY position descending rushYD; run; data bestbypos; set rushing1998; BY position; IF FIRST.position=1; run; data worstbypos; set rushing1998; BY position; IF LAST.position=1; run; proc print data=bestbypos; title 'Best Rushers for each position'; proc print data=worstbypos; title 'Worst Rushers for each position'; run;