Multiple choice technology programming languages

What happens if you use a GROUP BY clause in a PROC SQL step without a summary function?

  1. The step does not execute.

  2. The first numeric column is summed by default.

  3. The GROUP BY clause is changed to an ORDER BY clause.

  4. The step executes but does not group or sort data.

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

In PROC SQL, if you use GROUP BY without any summary (aggregate) functions like SUM, COUNT, AVG, etc., SAS automatically converts the GROUP BY clause to an ORDER BY clause. The step still executes but performs sorting instead of grouping. The other options are incorrect.

AI explanation

In PROC SQL, if you include a GROUP BY clause but don't use any summary (aggregate) function in the SELECT list, SQL has no aggregation to perform, so it silently treats the GROUP BY as equivalent to an ORDER BY, simply sorting the output by the grouping columns instead of collapsing rows.