scan do case case len(alltrim(身份证号))=18 ?substr(alltrim(身份证号),7,8) case len(alltrim(身份证号))=15 ?substr(alltrim(身份证号),7,6) endcase endscan