You have six bits similar to
(max(pageLikesN)-min(pageLikesN))
that are used for denominators in division. If any of them result in 0 the division cannot be performed
I also wonder if perhaps you missed an intended GROUP BY PageId. Your existing code would create multiple rows of identical values of the calculated variables for each row of the input data set keeping the Pageid value.
Example:
proc sql;
title 'No group';
select sex, min(weight)
from sashelp.class
;
title 'with group';
select sex, min(weight)
from sashelp.class
group by sex
;
quit;
Proc SQL will not create a CSV file directly. Either export the created table, use a data step to put to a csv file or possibly use ODS CSV destination and skip the create table and just use the select to send text to the output destination.
... View more