Remerging SUMMARY statistics note using PROC SQL


Using a SUMMARY function with a GROUP BY clause in PROC SQL might cause the following message to be written to the SAS Log:

NOTE: The query requires remerging summary statistics back with the original data.

This note is generated when a column, listed in the SELECT clause, is not being used in a SUMMARY function and the column is not listed in the GROUP BY clause. If the column that is selected is not used in a SUMMARY function, adding it to a GROUP BY clause prevents the note from being generated.

When this situation occurs, summary groups are not collapsed into a single row per group, even if a GROUP BY clause is specified and the rows within the groups are identical. This is due to PROC SQL choosing a course of action based on the query, not the values of the columns.

If no GROUP BY clause is coded in the query, the complete table is treated as one group.