My apologies for redirecting your question in advance, but although it is not used for your script, bash may be convenient here if you have one:
bash -c 'echo $RANDOM'
will return a random integer. Therefore you can use:
RANDOM=`bash -c 'echo $RANDOM'`
from tcsh script to achieve the same variable.
source share