First... are you using csh?
Can you verify this the shell you are using?
If so, setenv is a built-in so I'm not sure why you
would get that particular error.
Can you supply more info. (maybe even the script)?
Also, it has been said the csh is not a good shell for
scripting for various reasons but an interesting (amusing)
article by Tom Christiansen discusses the "cons"...
Now while i agree with Tom, I would not begrudge
anyone the freedom to "find out for themselves"
http://www.dubois.ws/software/csh-tcsh-book/csh-whynot