Problem with sar command in cron job

HI,
I have a problem with 'sar' command.
I am using the sar comman in script.when i execute the script manually using ./filenae, i am getting the desired output.
But when i put the script in cron job i am not getting the desired value.

Below is the script..

sar > $_LOCATION/sar.txt
_IDLETIME=`tail -2 $_LOCATION/sar.txt | head -1 | tr -s ' ' ' ' | cut -d ' ' -f8 | cut -d '.' -f1`;
echo "Hi $_IDLETIME"
if [ $_IDLETIME -ge 60 ]
  echo $_IDLETIME
else
  echo "XXXX"
fi

what might be the cause of this issue.

Thanks,
Ahamed.

You have not set _LOCATION at the start of the script.
What output do you get from the manual and cron runs?

In my version of "sar" the penultimate line is a blank line. In your interactive mode, what output do you get from:

sar | head -5
sar | tail -5