Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have a requirement for monitoring setup.

Monitoring team says that if we can redirect the output of a command in AS400 to a logifle then they will be able to do the setup the monitoring alert.

I am new to AS400. Could anyone please let us know if there is any sample program which actually redirects the output of a command to a logfile.

share|improve this question
It's been a long time since I touched an AS400 so my vague ideas don't really warrant a proper answer, but you might try the OUTFILE command:… &… – RobM Oct 3 '13 at 8:46
OUTFILE is not a command, but it is a common parameter on many CL commands. – WarrenT Oct 3 '13 at 11:04
Which command are we talking about? – WarrenT Oct 3 '13 at 14:01
Please describe the process you need to monitor. Aside from the OUTFILE() parameter on many commands, there are APIs which can be called directly to get this sort of information. IBM i Navigator allows you to set monitors for certain events. Triggers can be set on tables, table changes can be logged to journals. If you describe what it is you need to monitor you'll probably get a more specific answer. – Buck Calabro Oct 3 '13 at 14:08

Well, the broad answer is "it depends".

Most CL commands produce output in one or more of three methods. If a command allows more than one of these methods, it will have an OUTPUT() parameter. If your command allows OUTPUT(*outfile) which will write information to database physical file member as you specify in the OUTFILE() parameter, and optionally the OUTMBR() parameter. You can look up your command's syntax here. The output file formats for various commands is documented here. A few commands may allow output to go to a stream file in the IFS.

If a command has print output, but not an *outfile option, you may be able to:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.