Can anyone find a bug in this code?? shell script

I have done a script and IT WORKS JUST PERFECT from command line...but in cron it has problems executing...

nawk -F"|" '          
{ s=substr($104,2,18)}
{b ++s}
END { for (i in b) print i, b } ' $1 > /path/to/files/TranId_w$2

q=`cat /path/to/files/TranId_w$2 | wc -l`
echo $q > /path/to/files/forME


nawk -F"|" -v x=$2 -v w=$(cat forME) '
{u=u+1; l=l+$66}
($66 != 0)&&($110 == 1)&&($111 == 0) { a=a+1; s=s+$66}
END { print x"|"u"|"l"|"w"|"s } ' $1 >> statistic



rm /path/to/files/TranId_w$2
rm forME

./ftp_PC statistic

and I execute it ./script1 file1 20061212
I think problem is somewhere in second nawk..becouse in cron I can see TranId_w$2 created every day but statistic is not updated..

can anyone help me with debug??

regards,

I think your problem may lie in the "cat forME" in the second nawk. Try giving a full path for that. Give a full path for that ftp_PC file as well.