Since this is the IML subforum, lets assume your data is stored in a matrix named SDATA.
Z=0;
do i=1 to (nrow(SDATA)-1);
Z=Z+(SDATA[i,1]-SDATA[i+1,1])*(SDATA[i+1,2]-[SDATA[i,2]);
end;
print Z;
a more efficient way would probably be to use 4 temporary matrices of dimension (nrow(SDATA)-1) and define them like X1=SDATA[1:nrow(SDATA)-1,2], X2=SDATA[2:nrow(SDATA), 2] etc. and use term by term multiplication operator which I forgot on the top of my head as it's been a while since I've used IML. More memory usage but fewer operations.
if you want to do this in regular SAS, look for lag<n> function, in your case lag1 function.
Vincent