The generic output queue monitor (GENOUTQMON) polls once or multiple times on a delayed basis and generates a sorted or unsorted list of all spool files in an output queue in the RJSSLIST file in QTEMP for a user-defined exit program to process.
 
Use an exit program with GENOUTQMON to:
  • Scan spool-file contents (RPTSEARCH) and act upon the results of the search.
  • Merge a group of spool files (RPTMRG).
  • Split a spool file (RPTSPLIT).
  • Move (CHGSPLFA) or delete (DLTSPLF) a spool file. 

Parameters for GENOUTQMON

  • Source output queue & Library - The output queue and library to monitor. 
  • After processing spool option - What do to with the input spool files after they are processed. You do not have to use this option in your exit program, but you must pass it.
    • *DELETE
    • *MARK ? mark spool files with the user data *SENT so that all future Report Splitter commands will skip them.
    • *MOVE ? move spool files to the output queue and library you choose in Move to Output Queue & Library.
    • *CUSTOM
    • *NONE ? do nothing.
  • Delay processing or run once:
    • *DELAY ? Monitor the output queue regularly for new spool files to process.
    • *ONCE ? Run the monitor once. This option is useful for testing.
  • Delay between cycles - If you chose *DELAY in Delay Processing or Run Once, the number of seconds between the end of one monitoring cycle and the beginning of the next.
  • Time to end program - If you chose *DELAY in Delay Processing or Run Once, the time of day each day that the monitor stops running. Use the format HHMMSS.
  • Move to output queue & Library - If you choose *MOVE in After Processing Spool Option, the output queue and library to move the input spool files to in the exit program. You do not have to use this option in your exit program, but you must pass it. You can pass blanks.
  • Exit pgm to process queue list & Library - The name of the exit program to call after all spool files are listed in the work file. You must pass this parameter.
  • Select spool file - A spool-file name that restricts which spool files in the output queue to process. You can pass blanks.

    Note: You can use a question mark (?) as a wildcard character in all the spool-file filter parameters. Wildcards cannot be used for the starting character.

  • Select user data - A user data value that restricts which spool files in the output queue to process. You can pass blanks.
  • Select user ID - A user ID that restricts which spool files in the output queue to process. You can pass blanks.
  • Select job name  - A job name that restricts which spool files in the output queue to process. You can pass blanks.
  • Select form type - A form type that restricts which spool files in the output queue to process. You can pass blanks.
  • Select program - A program name that restricts which spool files in the output queue to process. You can pass blanks.
  • Select user defined data - User defined ata that restricts which spool files in the output queue to process. You can pass blanks.
  • After process if process error - Whether to still perform the After Processing Spool Option even on spool files that generate errors. The default value is *NO. You do not have to use this option in your exit program, but you must pass it.
  • RJSSLIST SQL where/sort order - A value to pass to the SQL where/sort parameter of the exit program. You do not have to use this option in your exit program, but you must pass it. You can pass blanks.

    For example: The sample exit programs GENOQEX03 and GENOQEX04 in the SOURCE file in the RJSSPLIT library use SQL to sort a list of spool files.

  • Optional dest output queue - A value to pass to the optional destination outpue queue parameter of the exit program. You do not have to use this option in your exit program, but you must pass it. You can pass blanks.
  • Optional error output queue - A value to pass to the error outpue queue parameter of the exit program. You do not have to use this option in your exit program, but you must pass it. You can pass blanks.
  • Optional spool search criteria - A text search-string value to pass to RPTSEARCH or any user-defined logic. You do not have to use this option in your exit program, but you must pass it. You can pass blanks.

    Note: You must type a semi-colon (;) at the end of the search string as both a delimiter and a terminator.

Command Examples

To monitor an output queue named REPORTS, call the exit program GENOQEX01 after listing all the spool files, and pass the search criteria 51024 to the exit program for the RPTSEARCH command, use:
 
GENOUTQMON OUTQ(REPORTS) SPLFOPT(*MARK) DELAY(*ONCE) EXITPGM(QGPL/GENOQEX01) SRCHCRIT('51024;') 
 
To monitor an output queue named REPORTS every 5 minutes until 5 pm, call the exit program GENOQEX01 after listing all the spool files, pass the search criteria 51024 to the exit program for the RPTSEARCH command, and move spool files to the output queue EMAIL after the exit program processes them, use:
 
GENOUTQMON OUTQ(QUSRSYS/REPORTS) SPLFOPT(*MARK) DELAY(*DELAY) DLYTIM(300) ENDTIME(170000) EXITPGM(QGPL/GENOQEX01) DESTOUTQ(QUSRSYS/EMAIL) SRCHCRIT('51024;')
 

Sample Exit Programs

 
There are 4 sample exit programs in the SOURCE file in the RJSSPLIT library:

Note: All samples write to the GENOQLOG00 log file.

  • GENOQEX01 and GENOQEX02 sequentially read RJSSLIST for processing.
  • GENOQEX03 uses SQL to sort the output queue list by job name and user data before processing and then merges (RPTMRG) all reports with the job name and user data combination.
  • GENOQEX04 uses SQL to read the report, searches each spool file for a specified criteria string, and moves the spool file to a different output queue depending on whether the string was found or not.

 

Still have questions? We can help. Submit a case to technical support

Last Modified On:
You don't have the appropriate permissions.
No, open a new Support Case