Vous êtes sur la page 1sur 7

data=node;ha.

add();
rc=hi.first();
do while(rc=0);
from=last;rx=from_to.find();
do while(rx=0);
key=to;ry=_ha.check();
if ry ne 0 then do;
node=to;output;rr=no.remove(key:node);
key=to;_ha.add();
count+1;
last=to;ha.add();
end;
rx=from_to.flast;rx=from_to.find();
do while(rx=0);
key=to;ry=_ha.check();
if ry ne 0 then do;
node=to;output;rr=no.remove(key:node);
key=to;_ha.add();
count+1;
last=to;ha.add();
end;
rx=from_to.find_next();
end;
rc=hi.next();
end; x;
input Dealer_id Addre;
from=last;rx=from_to.find();
do while(rx=0);
key=to;ry=_ha.check();
if ry ne 0 then do;
node=to;output;rr=no.remove(key:node);
key=to;_ha.add();
count+1;
last=to;ha.add();
end;
rx=from_to.flast;rx=from_to.find();
do while(rx=0);
key=to;ry=_ha.check();
if ry ne 0 then do;
node=to;output;rr=no.remove(key:node);
key=to;_ha.add();
count+1;
last=to;ha.add();ss_1 $20.;
cards;
5 madhur
1 Rom=node;ha.add();
rc=hi.first();
do while(rc=0);
from=last;rx=from_to.find();
do while(rx=last;rx=from_to.find();
do while(rx=0);
key=to;ry=_ha.check();
if ry ne 0 then do;
node=to;output;rr=no.remove(key:node);
key=to;_ha.add();
count+1;
last=to;ha.add();
end;
rx=from_to.find_next();
end;
rc=hi.next();
end; x;
input Dealer_id Address_1 $20.;
cards;
5 madhur
1 Rom=node;ha.add();
rc=hi.first();
do while(rc=0);
from=last;rx=from_to.find();
do while(rx=0);
key=to;ry=_ha.check();
if ry ne 0 then do;
node=to;output;rr=no.remove(key:node);
key=to;;
from=last;rx=from_to.find();
do while(rx=0);
key=to;ry=_ha.check();
if ry ne 0 then do;
node=to;output;rr=no.remove(key:node);
key=to;_ha.add();
count+1;
last=to;ha.add();
end;
rx=from_to.flast;rx=from_to.find();
do while(rx=0);
key=to;ry=_ha.check();
if ry ne 0 then do;
node=to;output;rr=no.remove(key:node);
key=to;_ha.add();
count+1;
last=to;ha.add();_ha.add();
count+1;
last=to;ha.add();
end;
rx=from_to.find_next();
end;
rc=hi.next();
end;e 1020
2 Rome 1020P
3 Paris-SuiteB
4 Paris2 SuiteB3
6 madhurk
7 xyx
8 abc
;
run;

proc sql;
create table have as
select a.Dealer_id as id1, a.address_1 as from,b.address_1 as to,
spedis(a.address_1,b.address_1) as spd
from x as a,x as b
where a.address_1 ne b.address_1
group by a.address_10);
key=to;ry=_ha.check();
if ry ne 0 then do;
node=to;output;rr=no.remove(key:node);
key=to;_ha.add();
count+1;
last=to;ha.add();
end;
rx=from_to.find_next();
end;
rc=hi.next();
end;e 1020
2 Rome 1020P
3 Paris-SuiteB
4 Paris2 SuiteB3
6 madhurk
7 xyx
8 abc
;
run;

proc sql;
create table have as
select a.Dealer_id as id1, a.address_1 as from,b.address_1 as to,
spedis(a.address_1,b.address_1) as spd
from x as a,x as b
where a.address_1 ne b.address_1
group by a.address_1ind_next();
end;
rc=hi.next();
end; x;
input Dealer_id Address_1 $20.;
cards;
5 madhur
1 Rom=node;ha.add();
rc=hi.first();
do while(rc=0);
from=last;rx=from_to.find();
do while(rx=0);
key=to;ry=_ha.check();
if ry nelast;rx=from_to.find();
do while(rx=0);
key=to;ry=_ha.check();
if ry ne 0 then do;
node=to;output;rr=no.remove(key:node);
key=to;_ha.add();
count+1;
last=to;ha.add();
end;
rx=from_to.find_next();
end;
rc=hi.next();
end; x;
input Dealer_id Address_1 $20.;
cards;
5 madhur
1 Rom=node;ha.add();
rc=hi.first();
do while(rc=0);
from=last;rx=from_to.find();
do while(rx=0);
key=to;ry=_ha.check();
if ry ne 0 then do;
node=to;output;rr=no.remove(key:node);
key=to;_ha.add();
count+1;
last=to;ha.add();
end;
rx=from_to.find_next();
end;
rc=hi.next();
end;e 1020
2 Rome 1020P
3 Pari;
from=last;rx=from_to.find();
do while(rx=0);
key=to;ry=_ha.check();
if ry ne 0 then do;
node=to;output;rr=no.remove(key:node);
key=to;_ha.add();
count+1;
last=to;ha.add();
end;
rx=from_to.flast;rx=from_to.find();
do while(rx=0);
key=to;ry=_ha.check();
if ry ne 0 then do;
node=to;output;rr=no.remove(key:node);
key=to;_ha.add();
count+1;
last=to;ha.add();s-SuiteB
4 Paris2 SuiteB3
6 madhurk
7 xyx
8 abc
;
run;

proc sql;
create table have as
select a.Dealer_id as id1, a.address_1 as from,b.address_1 as to,
spedis(a.address_1,b.address_1) as spd
from x as a,x as b
where a.address_1 ne b.address_1
group by a.address_1 0 then do;
node=to;output;rr=no.remove(key:node);
key=to;_ha.add();
count+1;
last=to;ha.add();
end;
rx=from_to.find_next();
end;
rc=hi.next();
end;e 1020
2 Rome 1020P
3 Paris-SuiteB
4 Pari;
from=last;rx=from_to.find();
do while(rx=0);
key=to;ry=_ha.check();
if ry ne 0 then do;
node=to;output;rr=no.remove(key:node);
key=to;_ha.add();
count+1;
last=to;ha.add();
end;
rx=from_to.flast;rx=from_to.find();
do while(rx=0);
key=to;ry=_ha.check();
if ry ne 0 then do;
node=to;output;rr=no.remove(key:node);
key=to;_ha.add();
count+1;
last=to;ha.add();s2 SuiteB3
6 madhurk
7 xyx
8 abc
;
run;

proc sql;
create table have as
select a.Dealer_id as id1, a.address_1 as from,b.address_1 as to,
spedis(a.address_1,b.address_1) as spd
from x as a,x as b
where a.address_1 ne b.address_1
group by a.address_1
having spedis(a.address_1,b.address_1)=
min(spedis(a.address_1,b.address_1));
quit;

data have;
set have;
if spd<50; run;

data full;
set have end=last;
if _n_ eq 1 then do;
declare hash h();
h.definekey('node');
h.define=node;ha.add();
rc=hi.first();
do while(rc=0);
from=last;rx=from_to.find();
do while(rx=0);
key=to;ry=_ha.check();
if ry ne 0 then do;
node=to;output;rr=no.remove(key:node);
key=to;_ha.add();
count+1;
last=to;ha.add();
end;
rx=from_to.find_next();
end;
rc=hi.next();
end;data('node','id1');
h.definedone();
end;
output;
node=from; h.replace();
from=t=node;ha.add();
rc=hi.first();
do while(rc=0);
from=last;rx=from_to.find();
do while(rx=0);
key=to;ry=_ha.check();
if ry ne 0 then do;
node=to;output;rr=no.remove(key:node);
key=to;_ha.add();
count+1;
last=to;ha.add();
end;
rx=from_to.find_next();
end;
rc=hi.next();
end;o; to=node;
output;
node=from; h.replace();
if last then h.output(dataset:'node');
*drop node;
run;

data want(keep =id1 household node);


declare hash ha(ordered:'a');
declare hiter hi('ha');
ha.definekey('count');
ha.definedata('last');
ha.definedone();
declare hash _ha(hashexp: 20);
_ha.definekey('key');
_ha.definedone();

if 0 then set full;


declare hash from_to(dataset:'full(where=(from is not missing and to is not
missing))',hashexp:20,multidata:'y');
from_to.definekey('from');
from_to.definedata('to','id1');
from_to.definedone();

if 0 then set node;


declare hash no(dataset:'node');
declare =node;ha.add();
rc=hi.first();
do while(rc=0);
from=last;rx=from_to.find();
do while(rx=0);
key=to;ry=_ha.check();
if r=node;ha.add();
rc=hi.first();
do while(rc=0);
from=last;rx=from_to.find();
do while(rx=0);
key=to;ry=_ha.check();
if ry ne 0 then do;
node=to;output;rr=no.remove(key:node);
key=to;_ha.add();
count+1;
last=to;ha.add();
end;
rx=from_to.find_next();
end;
rc=hi.next();
end;y ne 0 then do;
node=to;output;rr=no.remove(key:node);
key=to;_ha.add();
count+1;
last=to;ha.add();
end;
rx=from_to.find_next();
end;
rc=hi.next();
end;hiter hi_no('no');
no.definekey('node');
no.definedata('node','id1');
no.definedone();

do while(hi_no.next()=0);
household+1; output;
count=1;
key=node;_ha.add();
last=node;ha.add();
rc=hi.first();
do while(rc=0);
from=last;rx=from_to.find();
do while(rx=0);
key=to;ry=_ha.check();
if ry ne 0 then do;
node=to;output;rr=no.remove(key:node);
key=to;_ha.add();
count+1;
last=to;ha.add();
end;
rx=from_to.find_next();
end;
rc=hi.next();
end;
ha.clear();_ha.clear();
end;
stop;
run;

Vous aimerez peut-être aussi