Problem: Need to read sets of 5 pieces of data and keep in sync (i.e. know when you are reading a sales ID, when you are reading a sold-to, etc.) Solution #1: Run the loop once for each set of 5. loop forever read #1 break if end-of-file move to location #1 read #2 break if eof (shouldn't happen here, but...) move to location #2 ... read #5 break if eof (shouldn't happen here) move to location #5 end of loop --------------------------------------------- Solution #2: set flag to 0 loop until data is gone add 1 to flag if flag = 6, set flag back to 1 if flag = 1, move data to location #1 ... if flag = 5, move data to location #5 end of loop