• 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
    DRV Tech

    Get More Out of Your IBM i

    With soaring costs, operational data is more critical than ever. IBM shops need faster, easier ways to distribute IBM applications-based data to users more efficiently, no matter where they are.

    The Problem:

    For Users, IBM Data Can Be Difficult to Get To

    IBM Applications generate reports as spooled files, originally designed to be printed. Often those reports are packed together with so much data it makes them difficult to read. Add to that hardcopy is a pain to distribute. User-friendly formats like Excel and PDF are better, offering sorting, searching, and easy portability but getting IBM reports into these formats can be tricky without the right tools.

    The Solution:

    IBM i Reports can easily be converted to easy to read and share formats like Excel and PDF and Delivered by Email

    Converting IBM i, iSeries, and AS400 reports into Excel and PDF is now a lot easier with SpoolFlex software by DRV Tech.  If you or your users are still doing this manually, think how much time is wasted dragging and reformatting to make a report readable. How much time would be saved if they were automatically formatted correctly and delivered to one or multiple recipients.

    SpoolFlex converts spooled files to Excel and PDF, automatically emailing them, and saving copies to network shared folders. SpoolFlex converts complex reports to Excel, removing unwanted headers, splitting large reports out for individual recipients, and delivering to users whether they are at the office or working from home.

    Watch our 2-minute video and see DRV’s powerful SpoolFlex software can solve your file conversion challenges.

    Watch Video

    DRV Tech

    www.drvtech.com

    866.378.3366

    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

  • Big Blue Raises IBM i License Transfer Fees, Other Prices
  • Keep The IBM i Youth Movement Going With More Training, Better Tools
  • Remain Begins Migrating DevOps Tools To VS Code
  • IBM Readies LTO-10 Tape Drives And Libraries
  • IBM i PTF Guide, Volume 27, Number 23
  • SEU’s Fate, An IBM i V8, And The Odds Of A Power13
  • Tandberg Bankruptcy Leaves A Hole In IBM Power Storage
  • RPG Code Generation And The Agentic Future Of IBM i
  • A Bunch Of IBM i-Power Systems Things To Be Aware Of
  • IBM i PTF Guide, Volume 27, Numbers 21 And 22

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