CL Command Reference - STRMONOND
CL Command List > STRMONOND Reference
Description:
The Start Monitor for OnDemand (STRMONOND) command allows you to specify the name of an output queue or directory to monitor. The spooled files in the output queue, or the files in the directory, will be automatically processed by ADDRPTOND.
Once files are processed they are controlled by the value of the DLTSPLF parameter. Spooled files are additional controlled by the settings of the ERROUTQ and the PRCOUTQ parameters. If DLTSPLF is *YES then successfully processed files will be deleted. If it is *NO then successful spooled files will be moved to the output queue named in the PRCOUTQ parameter, successful directory files will have ĄŻ.PRCĄŻ added to the end of file name. Unsuccessful files will never be deleted. Spooled files will end up in the output queue specified in the ERROUTQ parameter, directory files will have ĄŻ.ERRĄŻ added to end of the file name.
You can end the monitor by:
. Specifying a method for the monitor to end automatically.
. Running the ENDMONOND command.
. Ending the monitor job using the ENDJOB command. Specify OPTION(*CNTRLD) and DELAY(999999). The job will end as soon as the monitor finishes processing the current report.
Examples:
Example 1: Simple Example
STRMONOND OUTQ(QUSRRDARS/ONDEMANDQ)
This command submits a job to batch that monitors for spooled files that are to be archived into OnDemand Common Server. When issued with no other parameters, the monitor uses the spooled file name attribute of the spooled file as both the application group name and application name. Spooled files that do not archive successfully are moved to the ONDERR output queue in the QUSRRDARS library. Spooled files that do archive successfully are also not deleted; they are moved to the ONDPROC output queue in the QUSRRDARS library. This command as shown will submit the monitor job without any specified end criteria, and will process within the default instance called QUSROND.
Example 2: More Complex Example
STRMONOND OUTQ(QUSRRDARS/ONDEMANDQ) APPGRPSRC(*SPLFNAME *FORMTYPE)
APPSRC(*USERDATA) DLTSPLF(*YES)
ENDMON(*ENDTIME) ENDTIME(235900) INSTANCE(ACCTING)
This command submits a job to batch that monitors for spooled files that are to be archived into OnDemand Common Server. The monitor attempts to use spooled file name and then form type attributes of the spooled file (in that order) for use as the application group name. The monitor uses the user data attribute of the spooled file as the application name. With this command example, successfully processed spooled files are deleted automatically; spooled files that do not archive successfully are moved to the ONDERR output queue in the QUSRRDARS library. In this example, the monitor will end at one minute before midnight of the current day. All processing will occur within the ACCTING instance.
Example 3: Another More Complex Example
STRMONOND TYPE(*DIR) DIR(ĄŻ/mydirĄŻ) APPGRPSRC(*SECOND)
APPSRC(*THIRD) DLTSPLF(*YES) INSTANCE(ACCTING)
This command submits a job to batch that monitors for stream files that are to be archived into OnDemand Common Server. The monitor uses the second part of the file name as the application group name and the third part of the file name as the application name. With this command example, successfully processed stream files are deleted automatically; stream files that do not archive successfully are retained in their current directory with the suffix of .ERR appended to the end of the file. All processing will occur within the ACCTING instance.