ScottBass:
SQL vs Hash Objects:
Program efficiency comes when data set is very large almost reaching the resources-limit and/or the program runs several times a day. You may simply compare both the methods, see the time, both run time and CPU times and Memory they take. Decide the choice.
Inventing new algorithm:
If there is a SAS way, we prefer to use and at the same time, watch time and memory used. If you invent a new algorithm which takes relatively less time and less memory, why not use your new way? Sometimes, a SAS function may be available but requires data to be transformed into a new form using Proc SORT, Proc TRANSPOSE , ...It takes overhead. For instance, you have a data set of Patients, each Patient has measurements of blood sugar for 10 Visits, arranged into columns. You ask for 3 maximum Values and the corresponding Visit Numbers. There are SAS functions, SORTN(), LARGEST() and WHICHN(). You can not use these functions directly unless you transpose the columns or copied to a new array. In this circumstance, you can find a new User function to directly get statistics on SLICED Array.
Using More than one variable like STD:
Mark has already answered this. If it Arrays, it is possible to use parallel arrays to take care of additional variables. For, STD, have one
array for FREQ, one for SUM and one for CORRECTED SUM OF SQUARES.
... View more