data created; *infile 'e:\stat540files\sasdata_scores.txt'; FILENAME webpage URL 'http://people.stat.sc.edu/hitchcock/sasdata_scores.txt'; INFILE webpage; INPUT gamedate MMDDYY10. +1 VisitingTeam $20. +8 vscore 2.0 +2 HomeTeam $20. +8 hscore 2.0 Note $CHAR16. Bet COMMA10. +5 gametime TIME8.; centered_hscore = hscore-mean(hscore); /* Above DOES NOT work correctly */ avg_score = mean(vscore, hscore); /* Better representation of what mean function does */ trim_hteam = trim(HomeTeam); gamemonth = month(gamedate); gameday = day(gamedate); difflogs = log(vscore) - log(hscore); uphome = upcase(HomeTeam); trans_visit = translate(VisitingTeam,'+','&'); /* The following would NOT work: trans_visit = translate(VisitingTeam,' and ','&'); */ /* This works: */ trans_visit_2 = tranwrd(VisitingTeam,'&',' and '); run; proc print data=created; run;