Capturing stderr in ksh script within a script

I have seen lots of entries on stderr and stdout, but I did not see a solution to my question.

In running a script, I call another script. I want to capture output and error messages from the called script. I am able to redirect the stdout from the called script to my output file, but I don't seem able to capture the stderr portion.

Here is my line calling the script:

$READSCRIPT $ERRFILE | grep $RECNUMBER:   >> $MAILFILE 2>&1

$READSCRIPT is the outside script I am calling.
$ERRFILE is a file name parameter I am passing to that script
$MAILFILE is the output file

When I run the script: sh -x tim_gap
Here is an example of an error message in the screen output:
gzcat: 00035146.20110829_-_2342+1900.gz: No such file or directory

However, when I look at my output file, $MAILFILE, the error message does not exist. I do capture the stdout messages into $MAILFILE. Am I using the proper syntax?

I appreciate any suggestions.

Thanks.

You have to redirect it right when you run the command, not after the pipe. stderr doesn't pass through the pipe, it goes directly to the terminal.

Thanks for the reminder.

Here is the code I ended up using so that I could keep the order of the message:

$READSCRIPT $ERRFILE  2> $READERROR | grep $RECNUMBER: >> $MAILFILETMP
if [ -s $READERROR ]
then
    cat $READERROR >> $MAILFILETMP
fi