%macro elimd(data,id); /* Macro écrite par Patrick Brossier (GIP RECLUS) data tableau de fond de carte id liste des identificateurs des polygones Cette macro élimine les points alignés dans un fond de carte Version du 17/12/00 */ proc sort data=&data out=tempa equals;by &id segment; data tempa;set tempa;by &id segment; retain _a; if first.segment then cn+1; _x1=lag(x); _y1=lag(y); _a1=_a; if _x1=x then _a=9e10; else _a=(_y1-y)/(_x1-x); if _a^=_a1 | _a=. then cn+1; _n=_n_; drop _x1 _y1 _a1; data tempb;set tempa(drop=_a);by &id cn; if last.cn; keep x y; proc sort;by x y; data tempb;set tempb;by x y; if first.y; proc sort data=tempa(drop=_a);by x y; data tempc;merge tempa tempb(in=check); by x y; if check; drop cn; proc sort data=tempc out=&data(drop=_n);by _n; run; proc datasets dd=work nolist nowarn force nofs; delete tempa tempb tempc; run; quit; %mend;