Also, consider that the WHERE statement you have coded will also work directly with PROC MEANS, unless you have additional purpose for creating your DATA step file work.tda_&i&j.
At a minimum, if your input file is rather large, consider creating an INDEX or otherwise a VIEW to use with your program most efficiently.
Scott Barry
SBBWorks, Inc.
... View more