Make ID unique
Posted: June 5th, 2013, 7:09 pm
Hi,
How can I make the unique for the maho (Household's ID) in the form,
PROC MAHO
postproc
numeric e;
if $ = notappl then
e=display(003,"1.1.Mã số Hộ gia đình");
reenter;
endif;
if $>0 & $<=9 then
$ = tonumber(concat(matinh,mahuyen,maxa,edit("999",$)));
endif;
if $>=10 & $<=99 then
$ = tonumber(concat(matinh,mahuyen,maxa,"0",edit("99",$)));
endif;
if $>=100 & $<=999 then
$ = tonumber(concat(matinh,mahuyen,maxa,edit("999",$)));
endif;
Thanks,
Linh
How can I make the unique for the maho (Household's ID) in the form,
PROC MAHO
postproc
numeric e;
if $ = notappl then
e=display(003,"1.1.Mã số Hộ gia đình");
reenter;
endif;
if $>0 & $<=9 then
$ = tonumber(concat(matinh,mahuyen,maxa,edit("999",$)));
endif;
if $>=10 & $<=99 then
$ = tonumber(concat(matinh,mahuyen,maxa,"0",edit("99",$)));
endif;
if $>=100 & $<=999 then
$ = tonumber(concat(matinh,mahuyen,maxa,edit("999",$)));
endif;
Thanks,
Linh