城市处理
data profile1;
set profile;
format status 20. city2
20. Province2 $20.;
city1=tranwrd(city,'市','');/将字符串中的' '替换'市'/
Province1=tranwrd(Province,'市','');
if index(Province1,"省")>0 then Province2=Province1;
if index(city1,"省")>0 or index(city1,"自治区") then city2=city1;
if Province2="" then Province2=city2;
if city2 ne "" then city2=Province1;
if city2="" then city2=city1;
if Province2="" then Province2=Province1;
run;
网友评论