data ex;
array cost $10. cost1-cost4;
do i=1 to 100;
do j=1 to 4;
id=ranuni(0);
if id<0.2 then cost(j)="常客";
else if id<0.5 then cost(j)="普客";
else if id<0.8 then cost(j)="稀客";
else cost(j)="从不";
end;
output;
end;
drop i j id;
run;
data ex1;
length cost_type $10;
set ex;
array cost $ cost1-cost4;
do i=1 to dim(cost);
cust_type=cost(i);
cost_type=vname(cost(i));
output;
end;
drop i cost1-cost4;
run;