美文网首页
城市处理

城市处理

作者: 寒微123 | 来源:发表于2018-05-07 17:19 被阅读0次

城市处理
data profile1;
set profile;
format status 10. city120. city2 20. Province120. 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;

相关文章

网友评论

      本文标题:城市处理

      本文链接:https://www.haomeiwen.com/subject/genblftx.html