这个20.31写错了吧
程序代码如下:
data work.a;
length a $9. q $10. j $10. z 8.;
input a $ q $ j $ z;
a = substr(a,1,7);
datalines;
545205902 卷轴印 外单位 0.74
545205904 卷轴印 外单位 0.86
112572306 擦划伤 C102 1.202
112572307 擦划伤 C102 2.318
112631801 退火氧化 C103 1.275
112631802 卷取擦伤 C103 2.109
112656006 卷取擦伤 C103 2.146
112656106 卷取擦伤 C103 1.202
113027103 擦划伤 C103 2.031
113417906 擦划伤 C102 1.422
113884907 边浪 C103 4.756
114004405 肋排印 C137 2.453
114004406 肋排印 C137 2.6
;
run;
proc sql noprint;
create table work.b as
select distinct a,
q,
j,
sum(z) as sum
from work.a
group by a,q,j
order by a;
quit;
data work.c(keep = b c);
length b $7. c $50.;
set work.b;
by a;
b = substr(a,1,7);
if first.a then do;
c = catx('/',q,j,sum);
retain c;
end;else do;
d = catx('/',q,j,sum);
c = catx(' ',c,d);
retain c;
end;
if not last.a then delete;
label b = '母卷号=号码前7位';
label c = '缺陷汇总简述情况';
run;