Check file exist issue

I have created two scripts, one with hardcoded and another one with extract from file instead of hardcoded,

script:1
--------
#!/bin/ksh
filename="$one/file1.dat"
if [ -f $filename ]
then
echo "$filename has arrived." >> $logfile
else
echo "$filename has NOT yet arrived." >> $logfile
fi
:>

Result:
$one/file1.dat has arrived.

script:2
--------
#!/bin/ksh
outfile=$HOME/outputfile.lst
splitfile=$HOME/splitfile.lst
infile=$HOME/inputfile.lst
rm -f $infile
rm -f $splitfile
rm -f $outfile
sqlplus -s << sqlEOF
$user/$pass
whenever sqlerror exit 1
set head off pages 0
set feedback off
spool $infile
SELECT files
FROM tab1;
spool off
sqlEOF
cat $infile | while read filename time
do
checkfile=$filename
echo $checkfile,$filename >> $splitfile
if [ -f $checkfile ]
then
echo "$checkfile has arrived." >> $logfile
else
echo "$checkfile has NOT yet arrived." >> $logfile
fi
done

Here after execute the script sh script2.sh

  1. $infile contains,
    $one/file1.dat 101010
    $one/file2.dat 110011
    $two/file1.lst 090909
    $two/file2.lst 110011

  2. splitfile shows,
    $one/file1.dat,$one/file1.dat
    $one/file2.dat,$one/file2.dat
    $two/file1.lst,$two/file1.lst
    $two/file2.lst,$two/file2.lst

  3. outfile shows,
    $one/file1.dat has NOT yet arrived.
    $one/file2.dat has NOT yet arrived.
    $two/file1.lst has NOT yet arrived.
    $two/file2.lst has NOT yet arrived.

Here those above files are presents in UNIX directory still it shows NOT yet received and the same is working for script 1 (hardcoded with one single file) and script 2 is NOT working.

Please help me...

$outfile is defined at the top of the script but never written to. The output is to $logfile - which is not defined.

Sorry here Outfile -> logfile

We do hope you do not have filenames starting with a $ sign. Though unix will not stop you, it will give you grief. Let's assume that they are variables.
Where do the values of the variables $one and $two come from? Neither script sets a value for $one or $two.

In the first script where is the file it found? As $one is not set, is the file actually in the root directory?

Aside: In the second script "time" is the name of a unix command. Not advisible to call a variable the same name.

The issue has re-solved using,
checkfile=`eval echo $filename` instead of currently using checkfile=$filename

this eval statement looking & changing the directory that $one & $two with file and then its looking correctly.

Thanks for all your effort spent for me & kind support. Thanks!