• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Guru: At Last! A Tool To Search an Output Queue!

    November 6, 2017 Ted Holt

    As far as I’m concerned, a technician can’t have too many tools! I appreciate the good people of IBM for the software tools they provide to help us do our jobs. I also appreciate those people who freely share software tools they’ve written. I’m pleased to pass along a tool from faithful reader Tim Swearingen.

    The tool is a CL command called Search an Output Queue (SRCHOUTQ), and it fills a gap. You can use SRCHOUTQ to look for a string inside the spooled files of an output queue. The search, I am happy to say, is case-insensitive. Here’s more information, in Tim’s words:

    Earlier this year, as I was working on a project, we would have random failures that our users didn’t report. We knew we had a problem, but we couldn’t replicate the issue. The issue would be reported in the job log, but sifting through thousands of job logs hunting for the problem was a bit much.

    This story contains code, which you can download here.

    I had read in other articles that I could use Qshell’s catsplf and grep utilities to search the text of a spooled file. That was enough to motivate me into building a tool that would search an output queue for a desired string and display the results.

    The program doesn’t run fast when it is doing a text search. It has to do a brute force text search of each spooled file in the output queue you select. However, it won’t consume a lot of your system resources.

    When you run a search by *NAME, the search is much quicker as it is only scanning the spooled file attributes. The attributes searched are: name, owner or user data. A name search will make it easy to subset a group of spooled files in an OUTQ.

    SRCHOUTQ has three parameters:

    Parameter Description Remarks
    OUTQ The name of the output queue to search. Press F4 to be prompted with a list of the output queues in the library list.
    SRCHTYPE Determines the type of search being done. A text search will search the text in a spooled file. A Name search will search the attributes of spool files in the OUTQ *TEXT = Search spooled files for a text string

    *NAME = Search spooled files by Name, Owner or User data

    SRCHSTRING The search argument Case-insensitive

    Here’s the prompted :

    And here’s the result of a search :

    Says Tim,

    The results show up in a screen with options that are similar to those of the Work with Output Queue (WRKOUTQ) command. The display options are loaded from physical file SRCHOUTQOP. You can add, change, or delete options to fit your needs.

    Two downloadable save files accompany this article. The SRCHOUTQ save file has all of the objects for this tool compiled for IBM i 7.1. SRCHOUTSRC has the source code.

    Tim recommends you create a library named SRCHOUTQ and restore all the objects from the save files to that library, but that’s not a requirement. You can place the objects in any library you prefer.

    I appreciate Tim’s willingness to share this utility with fellow readers. I hope you will find it useful.

    RELATED STORY

    Case-Insensitive Searching Of Spooled Files

     

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags: Tags: 400guru, CL, Four Hundred Guru, IBM i

    Sponsored by
    Maxava

    Disaster Recovery Strategy Guide for IBM i

    Practical tools to implement disaster recovery in your IBM i environment. Fully optimized to include cloud recovery, replication and monitoring options.

    Download NOW!

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Mad Dog 21/21: Classics Then And Now Database Modernization: Methodology To Solve Problems

    7 thoughts on “Guru: At Last! A Tool To Search an Output Queue!”

    • Lurton Keel says:
      November 6, 2017 at 4:28 pm

      Copy Source not included in download?

      Reply
    • Bryan says:
      November 7, 2017 at 9:48 am

      Some better option than my older tool. http://bryandietz.us/scansplf.html

      Reply
    • Linda Buonasera says:
      November 9, 2017 at 12:42 pm

      Hi Ted and Tim.
      This is a great tool. I have downloaded the objects and source. Just testing the pre-compiled objects works fine, but I am trying to copy the source and create objects in my system. You have not included the source for “/Copy Source,ErrStatus ” in your savf. Could you possibly supply that source? Thanks!

      Reply
    • Sanjiv says:
      November 9, 2017 at 2:36 pm

      Good utility,created 7 using it.

      Tim should take out the Copyright & other personal comments from the source code while sharing it to public.

      Hope is employer has no objections to share it with cc comments.

      Reply
    • Linda Buonasera says:
      November 10, 2017 at 10:16 am

      Hi Ted and Tim,
      This is a great tool. I have successfully used the objects that you supplied in the save files to search an outq. However, when trying to compile the code that was supplied, i realized you left out one of the copy source members ‘/Copy Source,ErrStatus’. Could you please supply it in the comments or in another savf? Thanks!

      Reply
    • Ted Holt says:
      November 13, 2017 at 11:22 am

      Some of the source members were omitted from the download. The complete source code should be there now.

      Reply
    • Steve says:
      October 4, 2019 at 1:05 pm

      It works well, but it is very slow. Takes forever to search through a large outq

      Reply

    Leave a Reply Cancel reply

TFH Volume: 27 Issue: 73

This Issue Sponsored By

  • New Generation Software
  • ASNA
  • WorksRight Software
  • Maxava
  • Manta Technologies

Table of Contents

  • IBM Deal Prices Current Power8 Compute Like Future Power9
  • Database Modernization: Methodology To Solve Problems
  • Guru: At Last! A Tool To Search an Output Queue!
  • Mad Dog 21/21: Classics Then And Now
  • Should Spark In-Memory Run Natively On IBM i?

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • IBM Unveils Manzan, A New Open Source Event Monitor For IBM i
  • Say Goodbye To Downtime: Update Your Database Without Taking Your Business Offline
  • i-Rays Brings Observability To IBM i Performance Problems
  • Another Non-TR “Technology Refresh” Happens With IBM i TR6
  • IBM i PTF Guide, Volume 27, Number 18
  • Will The Turbulent Economy Downdraft IBM Systems Or Lift It?
  • How IBM Improved The Database With IBM i 7.6
  • Rocket Celebrates 35th Anniversary As Private Equity Owner Ponders Sale
  • 50 Acres And A Humanoid Robot With An AI Avatar
  • IBM i PTF Guide, Volume 27, Number 17

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle