I want to prefill a roster row from the firs roster based on a condition (If a row fills a condition, then add it to the second roster).
The picture shows the problem i get.
You are setting KNOWN_SCHOOL_NAME and SCHOOL_ID_KNOWN at the indexes of the original, so it matches the original. Using a counter like this and indexing into the new table using the counter instead of "i", you can instead set the new known table from the bottom up with no gaps.
numeric numKnown = 0; do i = 1 while i <= count(APP000) if KNOWING(i) = 1 then numKnown = numKnown + 1;
KNOWN_SCHOOL_NAME(numKnown) = SCHOOL_NAME(i);
SCHOOL_ID_KNOWN(numKnown) = SCHOOL_ID(i); endif; enddo;