data test;
... (load your dataset here)
Prev成交价格 = lag1(成交价格);
select;
when (成交价格>=Prev成交价格) 实际成交 = 成交数量;
when (成交价格<Prev成交价格) 实际成交 = 0-成交数量;
otherwise;
drop Prev成交价格;
run;
Of course you need to change "成交价格" and so on to your actual variable names. Have fun with SAS!