First character of variable

I am trying to detect 'nan' (not a number) string in my large txt file filled with lots of numbers. A file may have no or many 'nan'. It should be simple but getting errors. Any help appreciated. Here is what I have:

#!/bin/tcsh

set case1 = test0.txt
set chk = `grep 'nan' $case1`
set op = `$?`
if ($op == 0) then
     echo "no nan found"
else
    echo "nan found"
endif

Whatever is the file containing 'nan' or not, it always outputs "nan found"

Thank you.

grep command returns zero when it match the pattern and non zero when it does not match the pattern:

EXIT STATUS

The following exit values are returned:
0         One or more lines were selected.
1         No lines were selected.
>1        An error occurred.

try something like:

#!/bin/tcsh
 set case1 = test0.txt
set nan=1
grep -q "nan" $case1 || set nan=0
if ( $nan == 0 ) then
     echo "no nan found"
else
    echo "nan found"
endif

Why not use 'regular' return codes?

#!/bin/tcsh
set case1 = test0.txt
set search = nan

# Search value & set retval
grep -q "$search" "$case1"
set RET = $?

# Print result
if ( 0 == $RET ) then	
	echo "$RET - $search found"
else
	echo "$RET - $search not found"
endif

hth

EDIT:
By regular return value i mean:

EXPRESION || set nan=0

This will change the variable to zero (success) on fail, which is quite irritating when someone later has/will edit the script.

grep -q "$search" "$case1"
set RET = $?

This will set the return code always to what it was.

Also this way you could catch the error of a non existing file..
Example:

 ~ $ tcsh
grep: test0.txt: No such file or directory
2 - nan not found
2 ~ $ touch test0.txt
:) ~ $ tcsh
1 - nan not found
 ~ $ echo nan > test0.txt 
+ ~ $ tcsh
0 - nan found
 ~ $ 

Thank you all of the replies. Very helpful. Ended up using rdrtx1's solution.

Thank you.