Date: Mon, 17 Sep 2007 05:42:56 -0400
Reply-To: Dimitri Shvorob <dimitri.shvorob@VANDERBILT.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Dimitri Shvorob <dimitri.shvorob@VANDERBILT.EDU>
Subject: Re: COMPLEV vs. COMPGED
.. Ok, to answer my own question, COMPLEV seems to behave like COMPGED with
unit operation costs, although setting SINGLE and DOUBLE to zero does the
job just as well in the exercise below.
%macro compgedForensics;
proc transpose
data = sashelp.zipcode
out = temp1;
var city;
run;
data temp2;
set temp1;
array s[*] $ col1 - col100;
%do i = 1 %to 10;
do c&i. = 0 to 1;
%end;
call compcost('insert =',c1,'delete =',c2,
'finsert =',c3,'fdelete =',c4,
'append =',c5,'truncate =',c6,
'double =',c7,'single =',c8,
'replace =',c9,'freplace =',c10);
do i = 2 to dim(s);
d1 = abs(compged(s[i],s[i-1]) - complev(s[i],s[i-1]));
d2 = abs(compged(s[i-1],s[i]) - complev(s[i-1],s[i]));
d = max(d1,d2);
if d > 0 then leave;
end;
if d = 0 then output;
%do i = 1 %to 10;
end;
%end;
drop i d: _: col:;
run;
%mend;
%compgedForensics;
|