The interpolation specification I=JOIN generates line segments, so there could be many intersection between the two curves. You can find all the intersention points with the program (I added an x value to cover a special case) : data mydata; input x y z; datalines; 0 600 600 1 550 100 2 500 200 3 450 300 4 400 400 5 350 500 6 300 600 7 250 700 8 200 800 ; run; proc sort data=myData; by x; run; data meet(keep=x1 x2 xi yzi); set myData; x1=lag(x); x2=x; y1=lag(y); y2=y; z1=lag(z); z2=z; if _n_ > 1 then do; alpha = (z2-y2) / (y1-y2-z1+z2); if alpha ge 0 and alpha lt 1 then do; xi = alpha*x1 + (1-alpha)*x2; yzi = alpha*y1 + (1-alpha)*y2; output; end; end; else if y=z then do; xi = x; yzi = y; output; end; run; /* at this point, intersection points coordinates are in dataset meet */ proc sql; create table myGraphData as select A.*, B.xi, B.yzi from myData as A left join meet as B on A.x = B.x2; proc sgplot data=myGraphData; series x=x y=y; series x=x y=z; scatter x=xi y=yzi / markerattrs=(symbol=CircleFilled size=8); run; PG Extended by PG : of if you want to use proc gplot : proc sql; create table myGData as select * from (select x, y, z, . as yzi from myData) UNION (select xi, ., ., yzi from meet) order by yzi, x; symbol1 v=none INTERPOL=join c=blue width=5; symbol2 v=none INTERPOL=join c=red width=5; symbol3 v=dot INTERPOL=none c=green width=5; proc gplot data=myGData; plot (y z yzi)*x/overlay; run; quit;
... View more