Start Monitor for OnDemand (STRMONOND)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

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:

Top

Parameters

Keyword Description Choices Notes
TYPE Type *OUTQ, *DIR Optional
OUTQ Output queue Qualified object name Optional, Positional 1
Qualifier 1: Output queue Name
Qualifier 2: Library Name, *LIBL, *CURLIB
DIR Directory Path name Optional
APPGRPSRC Value for application group Element list Optional
Element 1: Check first *SPLFNAME, *FORMTYPE, *USERDATA, *JOBNAME, *USRDFNOPT1, *USRDFNOPT2, *USRDFNOPT3, *USRDFNOPT4, *USRDFNDTA, *FIRST, *SECOND, *THIRD, *FOURTH
Element 2: Check next *NONE, *FORMTYPE, *USERDATA, *JOBNAME, *USRDFNOPT1, *USRDFNOPT2, *USRDFNOPT3, *USRDFNOPT4, *USRDFNDTA, *SPLFNAME, *SECOND, *THIRD, *FOURTH, *FIRST
Element 3: Check last *NONE, *USERDATA, *JOBNAME, *USRDFNOPT1, *USRDFNOPT2, *USRDFNOPT3, *USRDFNOPT4, *USRDFNDTA, *SPLFNAME, *FORMTYPE, *THIRD, *FOURTH, *FIRST, *SECOND
APPSRC Value for application name Element list Optional
Element 1: Check first *APPGRP, *SPLFNAME, *FORMTYPE, *USERDATA, *JOBNAME, *USRDFNOPT1, *USRDFNOPT2, *USRDFNOPT3, *USRDFNOPT4, *USRDFNDTA, *FIRST, *SECOND, *THIRD, *FOURTH
Element 2: Check next *NONE, *FORMTYPE, *USERDATA, *JOBNAME, *USRDFNOPT1, *USRDFNOPT2, *USRDFNOPT3, *USRDFNOPT4, *USRDFNDTA, *SPLFNAME, *SECOND, *THIRD, *FOURTH, *FIRST
Element 3: Check last *NONE, *USERDATA, *JOBNAME, *USRDFNOPT1, *USRDFNOPT2, *USRDFNOPT3, *USRDFNOPT4, *USRDFNDTA, *SPLFNAME, *FORMTYPE, *THIRD, *FOURTH, *FIRST, *SECOND
ERROUTQ Error output queue Qualified object name Optional
Qualifier 1: Error output queue Name, ONDERR
Qualifier 2: Library Name, QUSRRDARS, *LIBL, *CURLIB
DLTSPLF Delete processed file *NO, *YES Optional
PRCOUTQ Processed output queue Qualified object name Optional
Qualifier 1: Processed output queue Name, ONDPROC
Qualifier 2: Library Name, QUSRRDARS, *LIBL
ENDMON End monitor automatically *NO, *NOINPUT, *NBRHRS, *ENDTIME Optional
NBRHRS Number of hours to run 1-999, 8 Optional
ENDTIME Time to end Time, 230000 Optional
NBRMON Number of monitors to start 1-99, 1 Optional
INSTANCE Instance Character value, QUSROND Optional
SBMJOB Submit to batch *YES, *NO Optional
JOBD Job description Qualified object name Optional
Qualifier 1: Job description Name, QOND400
Qualifier 2: Library Name, QRDARS, *LIBL, *CURLIB
Top

Type (TYPE)

Specifies the type of monitor.

*OUTQ
Monitor the output queue named in the OUTQ parameter.
*DIR
Monitor the directory named in the DIR parameter.
Top

Output queue (OUTQ)

Specifies the name and library of the output queue for which a monitor is to be started. A value must be provided if TYPE(*OUTQ) is specified.

Qualifier 1: Output queue

output-queue-name
Specify the name of the output queue to monitor.

Qualifier 2: Library

*LIBL
All libraries in the job's library list are searched until the first match is found.
*CURLIB
The current library for the job is where the output queue is located. If no library is specified as the current library for the job, QGPL is used.
name
Specify the name of the library where the output queue is located.
Top

Directory (DIR)

Specifies the directory to monitor. A value must be provided if TYPE(*DIR) is specified.

When a directory is monitored, the monitor looks for files to process in that directory. Each file that is found in the directory will be processed. The file names should contain the application group and application name. For example, 'CHECKSTMTS.BIGSTMTS.data'. The monitor can use any one of the first 4 parts of the file name based on the values you specify for the APPGRPSRC and APPSRC parameters. When a file is processed successfully, '.PRC' is appended to the file name unless you have specified DLTSPLF(*YES) . If the load fails or if the values determined for application group and application are not valid, '.ERR' is appended to the file name. Files that end in .PRC or .ERR will not be processed.

Top

Value for application group (APPGRPSRC)

For spooled files specifies which spooled file attribute to use as the application group name. For directory files specifies which part of the file name to use as the application group name. Up to three sources can be specified. If a valid application group name is not found using the first source, the second source is used. If a valid application group name is not found using the second source, the third source is used.

Each value other than *NONE can only be used once.

Element 1: Check first

*SPLFNAME
Use the spooled file name as the source for the name.
*FORMTYPE
Use the form type as the source for the name.
*USERDATA
Use the user data as the source for the name.
*JOBNAME
Use the job name as the source for the name.
*USRDFNOPT1
Use the user-defined option 1 as the source for the name.
*USRDFNOPT2
Use the user-defined option 2 as the source for the name.
*USRDFNOPT3
Use the user-defined option 3 as the source for the name.
*USRDFNOPT4
Use the user-defined option 4 as the source for the name.
*USRDFNDTA
Use the user-defined data as the source for the name.
*FIRST
Use the part of the file name up to the first period as the source for the name.
*SECOND
Use the part of the file name between the first period and the second period as the source for the name.
*THIRD
Use the part of the file name between the second period and the third period as the source for the name.
*FOURTH
Use the part of the file name between the third period and the fourth period as the source for the name.

The default source for the second or third source is:

*NONE
No further sources should be checked.

Element 2: Check next and Element 3: Check last

*FORMTYPE
Use the form type as the source for the name.
*USERDATA
Use the user data as the source for the name.
*JOBNAME
Use the job name as the source for the name.
*USRDFNOPT1
Use the user-defined option 1 as the source for the name.
*USRDFNOPT2
Use the user-defined option 2 as the source for the name.
*USRDFNOPT3
Use the user-defined option 3 as the source for the name.
*USRDFNOPT4
Use the user-defined option 4 as the source for the name.
*USRDFNDTA
Use the user-defined data as the source for the name.
*FIRST
Use the part of the file name up to the first period as the source for the name.
*SECOND
Use the part of the file name between the first period and the second period as the source for the name.
*THIRD
Use the part of the file name between the second period and the third period as the source for the name.
*FOURTH
Use the part of the file name between the third period and the fourth period as the source for the name.

The default source for the second or third source is:

*NONE
No further sources should be checked.
Top

Value for application name (APPSRC)

For spooled files specifies which spooled file attribute to use as the application. For directory files specifies which part of the file name to use as the application name. Up to three sources can be specified. If a valid application name is not found using the first source, the second source is used. If a valid application name is not found using the second source, the third source is used.

Each value other than *NONE can only be used once.

Element 1: Check first

*APPGRP
Use the application group name as the source for the application name. This value will also work if the application group only contains one application regardless of the name of the application.
*FORMTYPE
Use the form type as the source for the name.
*USERDATA
Use the user data as the source for the name.
*JOBNAME
Use the job name as the source for the name.
*USRDFNOPT1
Use the user-defined option 1 as the source for the name.
*USRDFNOPT2
Use the user-defined option 2 as the source for the name.
*USRDFNOPT3
Use the user-defined option 3 as the source for the name.
*USRDFNOPT4
Use the user-defined option 4 as the source for the name.
*USRDFNDTA
Use the user-defined data as the source for the name.
*FIRST
Use the part of the file name up to the first period as the source for the name.
*SECOND
Use the part of the file name between the first period and the second period as the source for the name.
*THIRD
Use the part of the file name between the second period and the third period as the source for the name.
*FOURTH
Use the part of the file name between the third period and the fourth period as the source for the name.

The default source for the second or third source is:

*NONE
No further sources should be checked.

Element 2: Check next and Element 3: Check last

*FORMTYPE
Use the form type as the source for the name.
*USERDATA
Use the user data as the source for the name.
*JOBNAME
Use the job name as the source for the name.
*USRDFNOPT1
Use the user-defined option 1 as the source for the name.
*USRDFNOPT2
Use the user-defined option 2 as the source for the name.
*USRDFNOPT3
Use the user-defined option 3 as the source for the name.
*USRDFNOPT4
Use the user-defined option 4 as the source for the name.
*USRDFNDTA
Use the user-defined data as the source for the name.
*FIRST
Use the part of the file name up to the first period as the source for the name.
*SECOND
Use the part of the file name between the first period and the second period as the source for the name.
*THIRD
Use the part of the file name between the second period and the third period as the source for the name.
*FOURTH
Use the part of the file name between the third period and the fourth period as the source for the name.

The default source for the second or third source is:

*NONE
No further sources should be checked.
Top

Error output queue (ERROUTQ)

Specifies the name of the output queue to receive spooled files that ADDRPTOND fails to load.

Qualifier 1: Error output queue

ONDERR
Spooled files that are not loaded are placed in the output queue named ONDERR.
error-queue-name
Specify the name of the output queue to receive spooled files that fail to load.

Qualifier 2: Library

QUSRRDARS
The output queue is located in library QUSRRDARS.
*LIBL
All libraries in the job's library list are searched until the first match is found.
*CURLIB
The current library for the job is where the output queue is located. If no library is specified as the current library for the job, QGPL is used.
name
Specify the name of the library where the output queue is located.
Top

Delete processed file (DLTSPLF)

Specifies whether or not to delete a spooled file or file that ADDRPTOND loads successfully. If ADDRPTOND is unsuccessful, the spooled file or file is not deleted.

*NO
The spooled file or file is not automatically deleted.
*YES
The spooled file or file is only deleted if the report was loaded successfully.
Top

Processed output queue (PRCOUTQ)

Specifies the name of the output queue to receive spooled files that ADDRPTOND loads successfully. This occurs only if DLTSPLF is *NO.

Qualifier 1: Processed output queue

ONDPROC
Spooled files that are loaded successfully are placed in the output queue named ONDPROC.
processed-queue-name
Specify the name of the output queue to receive spooled files that were loaded successfully.

Qualifier 2: Library

QUSRRDARS
The output queue is located in library QUSRRDARS.
*LIBL
All libraries in the job's library list are searched until the first match is found.
*CURLIB
The current library for the job is where the output queue is located. If no library is specified as the current library for the job, QGPL is used.
name
Specify the name of the library where the output queue is located.
Top

End monitor automatically (ENDMON)

Specifies if the monitor will automatically end and how.

*NO
Do not automatically end the monitor.
*NOINPUT
The monitor will end when the monitored output queue or directory has no more files that can be processed.

Note: Only spooled files in the ready state can be processed.

*NBRHRS
The monitor will end after it has run the number of hours specified on the NBRHRS parameter.
*ENDTIME
Specifies that the monitor is to end at the time specified on the ENDTIME parameter.
Top

Number of hours to run (NBRHRS)

Specifies how many hours the monitor is to run before automatically ending.

8
The monitor will automatically end after 8 hours.
1-999
Allow the monitor to run from 1 to 999 hours.
Top

Time to end (ENDTIME)

Specifies the time when the monitor will automatically end.

230000
The monitor will automatically end at 11:00 pm.
ending-time
Specify the time that the monitor should end. The time is specified in 24-hour format and can be specified with or without a time separator:
  • Without a time separator, specify a string of 4 or 6 digits (hhmm or hhmmss) where hh = hours, mm = minutes, and ss = seconds. Valid values for hh range from 00 to 23. Valid values for mm and ss range from 00 to 59.
  • With a time separator, specify a string of 5 or 8 digits where the time separator specified for your job is used to separate the hours, minutes, and seconds. If this command is entered from the command line, the string must be enclosed in apostrophes. If a time separator other than the separator specified for your job is used, this command will fail.

Note: If the ENDTIME is after the current time, the monitor will end at the time specified by ENDTIME today. If the ENDTIME is before the current time, the monitor will end at that time tomorrow.

Top

Number of monitors to start (NBRMON)

Specifies the number of monitors to start with these characteristics. Only one monitor can be started when TYPE is *DIR.

1
One monitor is started.
1-99
Specify the number of monitors to start.
Top

Instance (INSTANCE)

Specifies the name of the instance to use.

QUSROND
The default OnDemand instance is used.
instance-name
Specify the name of the instance that is to be used. By definition, the instance must be on the system that the command is run.
library-server-name
Specify the TCP/IP host name of the library server. The name can also be specified as a TCP/IP dotted decimal address in the form of nnn.nnn.nnn.nnn.

When a server name or TCP/IP address is entered, OnDemand uses the instance on that server that is using the default port. In most cases, this will also use the default instance.

Top

Submit to batch (SBMJOB)

Specify if you want to monitor the output queue or directory in the current job or in a another job.

Note: *YES must be specified when the NBRMON parameter is greater than 1.

*YES
This command should be submitted to run in a different job.
*NO
This command should be run within the current job. If you are entering this command from a terminal, this will prevent you from doing any other work from this terminal session until this command completes.
Top

Job description (JOBD)

Specifies the name of the job description used for the submitted job.

Qualifier 1: Job description

QOND400
The QOND400 job description is used as the job description for the submitted job.
name
Specify the name (name/name) of the job description used for the job.

Qualifier 2: Library

QRDARS
Library QRDARS is used as the job description's library.
*LIBL
All libraries in the job's library list are searched until the first match is found.
*CURLIB
The current library for the job is used to locate the job description name. If no library is specified as the current library for the job, QGPL is used.
name
Specify the name of the library where the job description name is located.
Top

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.

Top

Error messages

*ESCAPE Messages

CPF1338
Errors occurred on SBMJOB command.
OND0231
Output queue &1 in library &2 can not be monitored. No data queue is attached.
OND0281
Output queue &1 in library &2 can not be monitored. Another monitor is already active.
RDR0186
Output Queue &1 in library &2 not found.
Top