Clarification on if loop in Shell scripting

Hi,

I'm using Ksh and I'm seeing some of code in my programme as given below.

Could you please let me know whats is this meeaing ?
(I'm new to this unix)

       grep "1034" /u/kkk/bin/temp5.lst|cut -c1-2 >/u/kkk/bin/temp6.lst
        if [ -s /u/kkk/bin/temp6.lst ]
        then
            echo ""
            echo "090 Database is not running. Try again later!"
                echo "095 waiting 15 minutes"
            date
            sleep 900
        fi
        grep "3114" /u/kkk/bin/temp5.lst|cut -c1-2 >/u/kkk/bin/temp6.lst
        if [ -s /u/kkk/bin/temp6.lst ]
        then
                echo ""
                echo "100 Not connected to Oracle. Waiting 15 minutes!"
                echo "030 waiting 15 minutes"
                date
                sleep 900
        else
                more /u/kkk/bin/temp5.lst
                j=1
        fi

Thanks,
Shyamu.A

Appricaiated quick responce.

grep "1034" /u/kkk/bin/temp5.lst|cut -c1-2 >/u/kkk/bin/temp6.lst

This is a series of processes strung together using the pipe(|) and redirection(>) operators:
grep : Search for the string "1034" in the file /u/kkk/bin/temp5.lst and print those lines
cut: only print the first 2 characters of any match
print the result out as a new file "/u/kkk/bin/temp6.lst"

if [ -s /u/kkk/bin/temp6.lst ]
        then
            

If the file we redirected the output to is non-zero in size

echo ""
            echo "090 Database is not running. Try again later!"
                echo "095 waiting 15 minutes"
            date
            sleep 900
        fi

echo the messages above to STDOUT and wait 15 minutes (900 seconds)

grep "3114" /u/kkk/bin/temp5.lst|cut -c1-2 >/u/kkk/bin/temp6.lst
        if [ -s /u/kkk/bin/temp6.lst ]
        then
                echo ""
                echo "100 Not connected to Oracle. Waiting 15 minutes!"
                echo "030 waiting 15 minutes"
                date
                sleep 900

You should be able to piece that together from the previous block

        else
                more /u/kkk/bin/temp5.lst
                j=1
        fi

If the file has zero length page the file and set the variable "j" to 1

Thank you dude....