/* Richard A. DeVenezia * SUGI 29 - "Greetings from the Edge" * www.devenezia.com/papers */ /* NOTE: * The jars or directories containing the java classes * DataStepHashAdapter * _must_ be listed in the environment variable * CLASSPATH _prior_ to the SAS session being started. */ %include "sas\hash-macros.sas"; %let handle =; options mprint; %startServer ( policy = persist.policy , define = -Dnumber.of.hashes=10 ) %getHashHandle (handle_mv = handle, size=10000) data foo; do i = 1 to 1e4; j = ranuni(0); output; end; run; data _null_; declare javaobj ji ("DataStepHashAdapter"); do until (end); set foo end=end; ji.callVoidMethod ("put",&handle,i,j); end; ji.delete(); stop; run; data bar; declare javaobj ji ("DataStepHashAdapter"); do i = 1 to 1e4; ji.callDoubleMethod ("getDouble",&handle,i,j); output; end; run; %freeHashHandle ( handle = &handle ) ods listing; proc compare base=foo compare=bar; run;