create cursor tt (sfzh c(18),xb c(2))
insert into tt (sfzh) values ("123456789012345678")
insert into tt (sfzh) values ("123456789012345662")
insert into tt (sfzh) values ("123456789012345602")
insert into tt (sfzh) values ("123456789012345612")
replace all xb with iif(val(substr(sfzh,17,1))%2=0,"女","男")
browse