Hi, when renaming a variable in a proc sql, is the correct technique to reference the old or new variable name (see the two variables that have been renamed in the select statement) in the group statement (see sc.book1 and sc.scoreband_new that are currently the variables names in the group statement below)?
Should it be:
1) group by sc.scorecard_num, book, scoreband
2) group by sc.scorecard_num, sc.book1, sc.scoreband_new
proc sql;
create table testing as
select sc.scorecard_num
,sc.book1 as book
,sc.scoreband_new as scoreband
,count(*) as Volume
from arr_banded sc
left join (select scorecard_num, count(*) as total
from arr_banded group by scorecard_num) as tot
on sc.scorecard_num = tot.scorecard_num
group by sc.scorecard_num, sc.book1, sc.scoreband_new
order by sc.scorecard_num;
quit;
... View more