/***************************************************************************************************************** SAS file name: File location: _________________________________________________________________________________________________________________ Purpose: Author: Peter Clemmensen Creation Date: 18/11/2017 This program supports the example page "" on SASnrd.com *****************************************************************************************************************/ options fullstimer; options msglevel=i; options nonotes nosource; proc printto log="c:\Users\Peter\Desktop\MyLog.log"; run; options notes source; %passinfo; data MyData(drop=i); length ID $50 first_name $20 last_name $20; array first_names{20}$20 _temporary_ ("Paul", "Allan", "Bob", "Michael", "Chris", "David", "John", "Jerry", "James", "Robert", "Karen", "Betty", "Helen", "Sandra", "Sharon", "Laura", "Michelle", "Angela", "Melissa", "Amanda"); array last_names{20}$20 _temporary_ ("Smith", "Johnson", "Williams", "Jones", "Brown", "Miller", "Wilson", "Moore", "Taylor", "Hall", "Anderson", "Jackson", "White", "Harris", "Martin", "Thompson", "Robinson", "Lewis", "Walker", "Allen"); call streaminit(123); do i=1 to 10e6; ID=uuidgen(); first_name=first_names[ceil(rand("Uniform")*20)]; last_name=last_names[ceil(rand("Uniform")*20)]; output; end; run; /* Hash Object Search */ data callstack; length string $500; do exp=0 to 20; string=compbl(cats( "data Test; if 0 then set MyData; if _N_=1 then do; declare hash h(dataset:'MyData', hashexp:", exp, "); h.definekey('ID'); h.definedata(all:'Y'); h.definedone(); end; rc=h.find(key:uuidgen()); run;" )); output; call execute(string); end; run; proc printto; run; libname hshexp "c:\Users\Peter\Desktop\SAS\Hjemmeside\Posts\Drafts\Effect Of The Hash Object HASHEXP Method\"; %logparse(c:\Users\Peter\Desktop\MyLog.log,hshexp.PerfStat,,,append=NO); /* Plot performance data */ data hshexp.GraphData; set hshexp.Perfstat end=eof; where stepcnt ge 3; HashExp=stepcnt-3; keep HashExp realtime ; run; title "Elapsed Time For Increasing Values Of HASHEXP"; proc sgplot data=hshexp.GraphData; series x=HashExp y=realtime / markers markerattrs=(symbol=circlefilled); yaxis grid display=(nolabel); xaxis labelattrs=(weight=bolds size=12); format realtime time5.; run; title;