Talbot Michael Katz
2005-08-04 22:15:00 UTC
Hi.
Does a GROUP BY in PROC SQL always result in ORDER BY of the group
variables unless a different ordering is specified in an ORDER BY clause?
I just did a PROC SQL with "GROUP BY v1, v2" and "ORDER BY v1" only, but
the PROC CONTENTS told me that the data set was ordered by both v1 and
v2. If I leave the ORDER BY off, I get the same thing. If I explicitly
do "ORDER BY v2" only, it orders by v2 AND v1. If I ORDER BY a variable
not in the GROUP BY clause, then it orders by that variable only. If I
ORDER BY a subset of the GROUP BY variables, will it always try to use
every variable in the GROUP BY clause in the ordering?
-- TMK --
"The Macro Klutz"
Does a GROUP BY in PROC SQL always result in ORDER BY of the group
variables unless a different ordering is specified in an ORDER BY clause?
I just did a PROC SQL with "GROUP BY v1, v2" and "ORDER BY v1" only, but
the PROC CONTENTS told me that the data set was ordered by both v1 and
v2. If I leave the ORDER BY off, I get the same thing. If I explicitly
do "ORDER BY v2" only, it orders by v2 AND v1. If I ORDER BY a variable
not in the GROUP BY clause, then it orders by that variable only. If I
ORDER BY a subset of the GROUP BY variables, will it always try to use
every variable in the GROUP BY clause in the ordering?
-- TMK --
"The Macro Klutz"