A not uncommon problem with loop codes in macros can also be the scope of loop counter when one macro calls another.
Something like this could have accidentally incremented your loop counter one too many times.
%macro one ();
%do i= 1 %to 4;
%two
%put in macro one i is &i.;
%end;
%mend;
%macro two ();
%do i= 1 %to 5;
%put in macro two i is &i.;
%end;
%mend;
%one;
Note that the log shows a value of 6 for the macro variable &I even though neither loop explicitly uses it. So if you had an inner loop using the same range of 1 to 19 the last value could have been 20 creating the nonexistent set name.