It depends a bit on how the two rowsets are related.
If you think of your two rowsets as two rows in a datasheet, underneath each other - Are there gaps in your second rowset at random points throughout the column?
this is pretty hard to solve. You'd want an array, which a "RowsetFromString" never is.
Options I see:
Either fill the gaps with "some value", then you can simply write an if / else check to handle "some value" accordingly inside your loop.
Or sort both rowsets somehow, so the gaps are at the end:
Assuming that the order in both is the same and the only missing rows are sorted towards the end of your second column:
One approach could be to loop through your rowsets, and write them into a data extension side by side. Then you can do lookups and empty checks for pairs. This essentially acts as an array.
Another approach would be to use rowcount() on both sorted rowsets. Compare the two counts, and use only the smaller rowcount in a first for loop.
This will produce all your pairs.
Then, from the the smaller rowcount + 1, iterate through the rest of the records (the ones without a match) to the higher rowcount, just setting defaults instead of empty values, or producing an error.
Comparing rowcounts is a simple subtract and logical test.
IF Subtract(rowCount(rowset1),rowCount(rowset2) > 0 THEN