how to read two text files in the same shell script

Folks i have written two scripts that do reading of csv files , i am currently fetching the all part of the line in to variables and braking the line into several variables.

I am doing the same thing in an another shell script, i want to integrate both the scripts in to a single one where i can compare the variables of one file to an other file.
logic for reading is

while read line

do 
   
done< input

can anyone show the path to this....

Thank you
Venu

#!/bin/ksh

exec 7<firstFile
while read secondFileLine
do
    read firstFileLine <&7    
    printf "[${firstFileLine}] [${secondFileLine}]"
done < secondFile

Thank you Vgersh for the response, but i am looking for something along these lines..

read the first line of a first file and capture in to a variable

then

loop through a do while till the end of second file to find all the matches and if found then do the stuff

else
go back to second line of first file and again capture line into variable go through the loop.

this way till all the lines of first file are finished.

Thanks in advance for your help