in reply to question about bcp

You can't use bcp to put the result of a query into a file, bcp works with tables only.
For more information on Sybperl go to Michael Peppler's site. He is the author of Sybperl and DBD::Sybase.
The Sybperl man-page is here

To put the result of a query in a file use the way turumkhan suggested (though his snippet needs a bit of modification ;-).