Using an output queue monitor

You can use the Start Monitor (STRMONOND) command to start a monitor program for any output queue to receive spooled files for processing. The monitor continuously checks an output queue for spooled files, and allows IBM® Content Manager OnDemand to capture the spooled files as they arrive.

Important: IBM recommends using the monitors in a batch environment only.

You generally define and then manually store reports with the ADDRPTOND command during testing. Then, when the report is ready for production, you can automate storage with the Content Manager OnDemand monitor—if you use the *SPLFNAME, *FORMTYPE, *USERDATA, *JOBNAME, or *USRDFNxxxx spooled file attribute of the report to match the application group and application names you defined to Content Manager OnDemand.

The spooled files must be in ready status (RDY) on the output queue that you are monitoring. The first time a Monitor is started for an output queue, Content Manager OnDemand will create a data queue and attach it to the output queue being monitored. If there are spooled files already in that queue, the monitor will not detect them. If this happens, place these spooled files on hold, then release them. The Monitor should then detect and process them. This should only be necessary the first time a Monitor job is started for a particular output queue.

To begin capturing reports automatically when a spooled file arrives in a particular output queue, you can issue the STRMONOND command. The monitor runs continuously until the End time or Number of hours occurs. You can also use the End Monitor (ENDMONOND) command to stop processing.

The default job name for the monitor job is MONOUTQ. The job name can be overridden by using the Monitor job name (JOB) parameter on the STRMONOND command or the Job name field of the monitor definition in IBM Navigator for i. After the job has ended, the job log can be found with the User data (USRDTA) spooled file attribute set to the job name. For every spooled file that the monitor has processed, there will either be a successful load (message number 87) or a failure (message number 88) indicated in the System Log.

The monitor processes any spooled files that arrive in the named output queue in RDY (Ready) status. Spooled files with any other status are not affected by the monitor, and remain in the output queue until they are deleted or moved.

When a Common Server monitor job is active, the job status displayed by the Work with Active Jobs (WRKACTJOB) command changes a number of times during processing. The monitor job has a status of RUN when it is preparing to process a document (such as determining parameter values or running an exit program). It then spawns several jobs and goes to a status of TIMW while those jobs do the actual archiving. When the processing is complete, the status changes back to RUN while the monitor checks what needs to be done next. If there are no additional documents that are ready to be archived the monitor job goes into a DEQW status until the next document is ready to be archived or a request to end the monitor job is received.

You might want to add the STRMONOND command to your system startup program so the monitor(s) start each time you IPL the system.

When starting a Content Manager OnDemand output queue monitor (using the STRMONOND command) from a job scheduler, you might be unsure of what job description to use. In most cases, STRMONOND will work best using the QOND400 job description. You might have special system needs that require the use of your own job description, but this IBM-supplied job description will work successfully for many customers.

Jobs that load data by using the STRMONOND command must NOT have a CCSID value of 65535. If the job has a CCSID value of 65535, the load might fail. To resolve the problem, you can change the job to have a different CCSID value, change the CCSID setting of the user profile, or change the Coded character set identifier (QCCSID) system value.

See the online help for more information about these commands and their parameters.

Important: The Content Manager OnDemand server job must be running, otherwise the spooled files will fail to load.