data want;
set have;
Old_Occupation=Occupation ;
countnumber=countw(Old_Occupation);
if countnumber=0 then
output;
else do i= 1 to (countw(Old_Occupation));
Occupation = scan(Old_Occupation, i,' ');
output;
end;
drop i Old_Occupation;
run;
忘了分隔符是“;”
data want;
set have;
old_Occupation=Occupation ;
countnumber=countw(old_Occupation);
if countnumber=0 then
output;
else do i= 1 to (countw(old_Occupation));
Occupation = scan(old_Occupation, i,';');
output;
end;
drop i old_Occupation;
run;