Howard, To confess ... I did read the question and did run to fast into those words of "changing format" oops...( should say sorry) Seeing afterwards the question was also a variable type conversion. I left my answer as a fit for the original question. The best thing to do (good practice) could be solving the type when data is coming in. Infile/input options access/dbtype. The combining to an analytics dataset (by where processing) is an advice I agree. I looked at your nice paper http://support.sas.com/resources/papers/proceedings14/1277-2014.pdf The sum statement is not well known SAS(R) 9.4 Statements: Reference, Third Edition. I often fail to remember that one. The scope to just the SAS environment is an important one as you indicated, external dbms may support something. Advice of not using the monotonic function as not documented not reliable agree on that as good practice. Working out 5 approaches with a performance comparison, marvelous. Just a pitty a of the performance of the last two. But it is an indication what will happen if the dataset becomes larger. A long introduction... There is something missing, that is: "what the effects are of the multi-threading processing in proc sql (Tk-kernel)?". This is new since 9. The monotonic function can not be reliable anymore when there are several threads parallel processed. Using the macro-environment for intermediate storage and counting is thinking on a possible parallel interruption break on the wrong moment. It will hardly be possible to test or validate something like that. I think of an interrupt between symget/symput (FCMP usage). The probability that it will happen is almost zero, but is it really zero?
... View more