hello and thank you for all your responses; My final objectif in this work is to detects Prime Numbres of others. The error I made is not to stop the loop when the mod is 0. I understood my error by debugging my program with your help. Thanks again, if you have other suggestions, they are welcome. proc fcmp outlib=work.pack1.MyFunc1;
function MyFunc1(var$) $10;
length var1 $10;
do i =2 to int(sqrt(var));
if mod(var,i)=0 then do; var1="NbrNPre";leave;end;
else do; var1="NbrPre";end;
b= mod(var,i);
put var=;
put i=;
put b=;
end;
return (var1);
endsub;
quit;
data test;
input a;
cards;
34679
34678
23456789
; run;
options cmplib=work.pack1;
data test1;
set test;
result=MyFunc1(a);
run;
... View more