Hi guys.
Here's another solution.
If your not concerned about the final order of the rows, try this:
data OUT;
set IN (firstobs=2) end=_EOF ; /* first set starts at 2nd row */
if _EOF then do; /* deals with last row */
C=0;
output;
end;
C=B; /* stores value of B into C */
set IN; /* second set starts at 1st row */
output;
run;
this results in:
a b c
1 23 15
2 15 45
3 45 55
5 67 0
4 55 67
result is as expected, but the last row positions is switched with the previous.
Greetings from Portugal.
Daniel Santos at
www.cgd.pt