The following is an example of what you can use:
%macro mf;
%let i=0;
%do %until(&onechar=e or &i=10);
%let i=%eval(&i+1);
%let onechar=%substr(abcdefghij,&i,1);
%end;
%put onechar=&onechar;
%put i=&i;
%mend mf;
%mf;
The macro loop stops if it finds "e" or i=10.