Sure, you can redirect pretty much anything in Qshell to a file. Just
use the redirection operators. (The following should all be on one line,
in case the e-mail software wraps it)
Assuming that you just want to save error messages (which go to stderr,
which id descriptor #2) you'd code this:
find (parameters here) 2> /tmp/errors.txt
In that syntax, anything written to descriptor 2 (which is where erorr
messages go) is redirected to the /tmp/errors.txt file in the IFS.
Normal (non-error) messages are written to stdout, which is descriptor
#1, which you can redirect the same way, or you can omit the descriptor
number, since it's the default:
find (parameters here) > /tmp/errors.txt
If you're calling 'find' from a CL program, it might be easier to use
OVRDBF or OVRPRTF instead. For example:
OVRDBF FILE(STDERR) TOFILE(QTEMP/ERRORS)
STRQSH CMD('find (parameters here)')
DLTOVR FILE(STDERR)
You can override STDOUT as well (just specify STDOUT instead of STDERR)
and you can use OVRPRTF if you want to write the results to the spool
instead of writing it to a database file.
So... lots of options :)
Albert York wrote:
Thanks Scott,
Is there a way to pipe the output of this to a file?
Albert
As an Amazon Associate we earn from qualifying purchases.