COZ-Start SPOOL Print Monitor (STRPRTMON)

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

The Start OUTQ Print Monitor (STRPRTMON) command schedules the print monitor program. Monitoring can be performed system-wide LEVEL(*SYS) where individually by job and/or user profile.

Restrictions:

Top

Parameters

Keyword Description Choices Notes
LEVEL Monitor Level *SYS, *JOB Optional, Positional 1
OPTION Monitor option *CPYSPLF, *SAVSPLF, *COPY, *SAVE, *ACTIVATE, *INTER Optional, Positional 2
STATUS Print monitor status *ACTIVE, *HOLD Optional, Positional 3
OUTPUT Target OUTQ or SAVSPLF archive Single values: *COZTOOLS
Other values: Qualified object name
Optional, Positional 4
Qualifier 1: Target OUTQ or SAVSPLF archive Name
Qualifier 2: Library Name, *LIBL
DTAQ Data Queue for Monitor Qualified object name Optional, Positional 5
Qualifier 1: Data Queue for Monitor Name, COZPRTMON
Qualifier 2: Library Name, QGPL
EXITPGM Exit program to call Qualified object name Optional, Positional 6
Qualifier 1: Exit program to call Name, COZPRTMON
Qualifier 2: Library Name, *LIBL
JOBQ Job queue for monitor Qualified object name Optional, Positional 7
Qualifier 1: Job queue for monitor Name, QUSRNOMAX, QCTL, QINTER, QBATCH
Qualifier 2: Library Name, *LIBL
STRMON Start Monitoring Element list Optional, Positional 8
Element 1: Start Date Date, *CURRENT, *EOM
Element 2: Start Time Time, *CURRENT, *MIDNIGHT
ENDMON End Monitor Single values: *NONE
Other values: Element list
Optional, Positional 9
Element 1: End Date Date, *STRMON
Element 2: End Time Time, *MIDNIGHT
RESCD Reshedule Start Date... Single values: *NONE
Other values: Element list
Optional, Positional 10
Element 1: When scheduled day is *WEEKEND, *WEEKDAY, *SATSUN, *SUN, *MON, *TUE, *WED, *THU, *FRI, *SAT, *TUES, *THUR, *THURS
Element 2: Then use *PREV, *NEXT, *PRV
Element 3: Day of week to reschedule *DAY, *WEEKDAY, *WEEKEND, *SUN, *MON, *TUE, *WED, *THU, *FRI, *SAT, *TUES, *THUR, *THURS
LOG Write CL commands to joblog *YES, *NO Optional, Positional 11
SAVE Change SPLF SAVE(*YES|*NO) *YES, *NO, *SAME Optional, Positional 12
HOLD Change SPLF HOLD(*YES|*NO) *YES, *NO, *SAME Optional, Positional 13
OWNER Change SPLF OWNER to Name, *SAME Optional, Positional 14
USER Monitor these users Values (up to 12 repetitions): Name, *ALL Optional, Positional 15
OMITUSER Omit these users Values (up to 12 repetitions): Generic name, name, *ALLIBM Optional, Positional 16
USRDTAARA Data area for additional users Single values: *NONE
Other values: Qualified object name
Optional, Positional 17
Qualifier 1: Data area for additional users Name, *DFT, QPRTMONUSR
Qualifier 2: Library name or *LIBL Name, *LIBL, *CURLIB
Top

Monitor Level (LEVEL)

Specifies whether Print Monitoring is automatically set up for every new job entering the system after the STRPRTMON command is run.

*SYS
All jobs entering the system are monitored by the print monitor. Current/Active jobs are not monitored until the CHGPRTMON OPTION(*START) is performed within those jobs, or they were already set up with the QIBM_NOTIFY_CRTSPLF environment variable.
*JOB
Print Monitoring is setup only for Jobs that have the QIBM_NOTIFY_CRTSPLF environment variable added to them. One way to add this environment variable is to run CHGPRTMON OPTION(*START) parameter.
Top

Monitor Option (OPTION)

Specify the type of OPTION to be performed by the print monitor.

*CPYSPLF or *COPY
Any SPOOL files created by a job that is being monitored by the print monitor are copied to the target OUTQ using the COZTOOLS CPYPRTF command.
*SAVSPLF or *SAVE
Any SPOOL files created by a job that is being monitored by the print monitor are saved to the target SPOOL FILE ARCHIVE using the COZTOOLS SAVSPLF command.
*ACTIVATE
This option is used modify the system-wide or job-level QIBM_NOTIFY_CRTSPLF environment variable. When OPTION(*ACTIVATE) is specified, this command functions similar to the CHGPRTMON command; in fact, it will route the parameter to the CHGPRTMON command and then return without starting a new print monitor job. When OPTION(*ACTIVATE) is specified, only LEVEL and DTAQ parameters are considered.
Top
Top

Target OUTQ or SAVSPLF archive (OUTPUT)

Specify the name of the OUTQ or SPOOL FILE ARCHIVE database file that is the target of the print monitor. If the object specified for this parameter does not exist, it is created. The OUTPUT value is treated as an OUTQ when OPTION(*COPY or *CPYSPLF) is specified, and as the SPOOL File Archive database file when OPTION(*SAVE or *SAVSPLF) is specified.

Output

*COZTOOLS
Monitored SPOOL files are copied or saved as follows:

If OPTION(*COPY) is specified, then SPOOL files are copied to the Output Queue named USRPRTMON on the library list. If the USRPRTMON does not exist on the library list, it is created in the QUSRSYS library.

If OPTION(*SAVE) is specified, then SPOOL files are saved to the SPOOL File archive database file named USRSAVSPLF on the library list. If the USRSAVSPLF does not exist, it is created in the QGPL library.

name
Specify the name of an OUTQ or SPOOL FILE database Archive to store the copies of the monitored SPOOL files. If the file or OutQ does not exist, it is created.
Top

Data Queue for Monitor (DTAQ)

Specify the name of the data queue (*DTAQ) that receives the entries when a SPOOL file is created. This DTAQ is monitored by the Print Monitor.

Data Queue Name

COZPRTMON
The data queue specified for this parameter is created if it does not exist. The default is COZPRTMON in QGPL.
Top

Exit program to call (EXITPGM)

Specify the name of the Print Monitor program. This program can be any user-written program. A call to this program is submitted to QUSRNOMAX job queue. The COZTOOLS includes the Print Monitor Program named COZPRTMON in COZTOOLS.

Exit program to call

COZPRTMON
The COZTOOLS includes the Print Monitor Program named COZPRTMON in COZTOOLS.
Top

Job queue for monitor (JOBQ)

Specify the name of the jobq onto which the call to the EXITPGM is placed.

Job queue for monitor

QUSRNOMAX
The EXITPGM is placed on the IBM i QUSRNOMAX job queue.
QCTL
The EXITPGM is placed on the IBM i QCTL job queue.
QINTER
The EXITPGM is placed on the IBM i QINTER job queue.
QBATCH
The EXITPGM is placed on the IBM i QBATCH job queue.
name
The EXITPGM is placed on the job queue specified for this parameter.
Top

Start Monitoring (STRMON)

Specify the starting date and time for monitoring to begin. SPOOL FILES created prior to the start time are NOT included in monitoring.

Start Date

*CURRENT
If *CURRENT is specified, the current job date is the start date.
*EOM
If *EOM is specified, the last day of the month (based on today's date) is used as the monitor start date.
date
Specify the date for monitoring to begin.

Start Time

*CURRENT
If *CURRENT is specified, the current time is the start time.
*MIDNIGHT
If *MIDNIGHT is specified, the monitoring starts at 1 second passed midnight on the date specified. For example, to begin monitoring on the last day of the month, specify: STRMON(*EOM *MIDNIGHT)
time
Specify the starting time for the print monitor to begin.
Top

End Monitor (ENDMON)

Specify the termination date and time of the Print Monitor.

Single values

*NONE
The print monitor continues until the ENDPRTMON LEVEL(*SYS) is run or the job named STRPRTMON (probably running in QUSRNOMAX) is ended.

End Date

*STRMON
The date on which print monitoring ends is the same as the start date.
date
Specify the date on which the print monitor will automatically end.

End Time

*MIDNIGHT
Print monitoring ends at 23:59:59 on the date specified for the date portion of the ENDMON parameter.
time
Specify the time to end print monitoring on the date specified on the date portion of the ENDMON parameter.
Top

Reshedule Start Date... (RESCD)

When the schedule date of the STRMON falls on the day specified for this parameter, the STRMON date is rescheduled to the new day, also indicated on this parameter. For example, if *MONTHEND is specified and that date is a Saturday or Sunday, you may wish to run the print monitor on the prior Friday date, or perhaps the following Monday date. This parameter allows you to control the rescheduling.

Single values

*NONE
When no rescheduling is necessary, specify *NONE for this parameter.

Scheduled Day

*WEEKEND or *SATSUN
If the scheduled date from STRMON falls on a weekend (Saturday or Sunday) date, it will be rescheduled to the new day specified on the other parts of this parameter.
*WEEKDAY
If the scheduled date from STRMON falls on a weekday (Monday through Friday) date, it will be rescheduled to the new day specified on the other parts of this parameter.
*SUN, *MON, *TUE, *WED, *THU, *FRI, *SAT
Select the specific day that triggers the rescheduling.

Relative Operator

*PRV or *PREV
Specify the relative day operation to perform the rescheduling. The *PREV (previous) operator indicates that the previous or "prior" day (specified in the next element of this parameter) is used.
*NEXT
Specify the relative day operation to perform the rescheduling. The *NEXT operator indicates that the next day (specified in the next element of this parameter) is used.

Day of week to reschedule

*DAY
Use *DAY to indicate that the rescheduled date is the next day. That is the day following the date specified on the STRMON parameter.
*WEEKDAY
The date used to reschedule the STRMON date is the next week day (Monday through Friday).
*WEEKEND
The date used to reschedule the STRMON date is the next weekend date (Saturday or Sunday).
*SUN through *SAT
Specify a specific day of the week for the reschedule date.
Top

Log CL commands (LOG)

Specifies whether the internal CL commands run by the print monitor are written to the joblog as informational messages.

*YES
The CPYPRTF or SAVSPLF commands are written to the joblog as informational messages.
*NO
CL commands run by the print monitor are not written to the joblog.
Top

Change SPLF SAVE(*YES|*NO) (SAVE)

When OPTION(*COPY) is specified, the copy's SPOOL File SAVE attribute is modified.

*YES
When OPTION(*COPY) is specified, the copy's SPOOL File SAVE attribute is changed to SAVE(*YES).
*NO
When OPTION(*COPY) is specified, the copy's SPOOL File SAVE attribute is changed to SAVE(*NO).
*SAME
When OPTION(*COPY) is specified, the copy's SPOOL File SAVE is the same as the original SPOOL File.
Top

Change SPLF HOLD(*YES|*NO) (HOLD)

When OPTION(*COPY) is specified, the copy's SPOOL File HOLD attribute is modified.

*SAME
When OPTION(*COPY) is specified, the copy's SPOOL File HOLD attribute is the same as the original SPOOL File.
*YES
When OPTION(*COPY) is specified, the copy's SPOOL File HOLD attribute is changed to HOLD(*YES).
*NO
When OPTION(*COPY) is specified, the copy's SPOOL File HOLD attribute is changed to HOLD(*NO).
Top

Change SPLF OWNER to (OWNER)

When OPTION(*COPY) is specified, the copy's SPOOL File OWNER is set to the User Profile specified on this parameter.

*SAME
When OPTION(*COPY) is specified, the copy's SPOOL File OWNER is the same as the original SPOOL File.
name
Specify the user profile that is to be assign as the owner of the new SPOOL files created when OPTION(*COPY) is specified.
Top

Monitor these users (USER)

Specifies the user profiles whose SPOOL Files are monitored.

You can specify up to 12 user profiles for this parameter.

*ALL
All users' SPOOL Files are monitored and copied or saved.
name
Specify the name of 1 to 12 users to be monitored. The print monitor will skip all other user profiles.
Top

Omit these users (OMITUSER)

Specifies a list of users that are not monitored. Use this parameter when USER(*ALL) is specified and all users except certain ones should be monitored. This parameter supports generic names.

You can specify 12 user profile names for this parameter.

*ALLIBM
All user profile names beginning with the letter 'Q' or the the letters 'IBM' are omitted.
generic name
Specify the name of up to 12 users to omit.
Top
Top

Examples for STRPRTMON

Example 1: Start Print Monitoring

STRPRTMON LEVEL(*SYS) OPTION(*COPY) OUTPUT(QUSRSYS/ARCHIVE)

This STRPRTMON example starts the print monitor for all new jobs entering the system. It copies each new SPOOL file to the output queue named ARCHIVE in QUSRSYS. To change an active job so that it too is being monitored, run the CHGPRTMON command within the active job.

Example 2: Start Print Monitor in Selective Jobs

STRPRTMON LEVEL(*JOB) OPTION(*SAVE) OUTPUT(QGPL/USRSAVSPLF)

This command starts the Print Monitor for any job that has print monitoring enabled. New jobs entering the system are NOT automatically monitored. The new SPOOL files are save to a SPOOL File Archive named USRSAVSPLF in QGPL. For more information on SPOOL File Archives, see the SAVSPLF and RSTSPLF commands. To activate monitoring for an active job, run the CHGPRTMON OPTION(*START) command, and to end print monitoring for any giving job, run CHGPRTMON OPTION(*END)

Top

Error messages

Unknown
Top