You have received plenty of help on your question. But I
am still concerned. Why do you need to do this with PROC SQL
and not PROC SORT? If a Pointy-Haired Boss is making you do
this, then you are stuck. If you are trying to get around
a perceived weakness of PROC SORT, there may be any number of
better alternatives than the route you are taking.
David Cassell, CSC
Senior computing specialist