data raw;
set raw;
by zjzh zqdm rq;
array aa(4) price zqye ccjsl czjfss;
array bb(4);
retain bb1 bb2 bb3 bb4;
do i=1 to 4;
if aa(i)^=. then bb(i)=aa(i);
else if first.zqdm then bb(i)=.;
end;
if bb2>0 then output;
else if zqye=0 then output;
drop price zqye ccjsl czjfss count i;
run;
data result(rename=(bb1=price bb2=zqye bb3=ccjsl bb4=czjfss));
set raw;
if a=. then a=0;
if b=. then b=0;
run;