Thanks Mark. I was expecting to obtain good results from the stored procedure. Instead of using many set commands, I expected to use teh stored procedure and have lots of information in one report, indeed I am not giving up, I shall open a case with Sybase.
Oh, by the way, if I use the set commens it works well.
set statistics plancost on
go
query
go