To get the longest viewing period for a given ID I can use the following code. But, how can I also retrieve the channel that corresponds to the longest viewing period. I apologize for my pathetic attempt at formatting
proc means data=new1 noprint max nway missing;
class ID;
var duration;
output out=sample_max (drop=_type_ _freq_) max=;
run;