• 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
    WorksRight Software

    Do you need area code information?
    Do you need ZIP Code information?
    Do you need ZIP+4 information?
    Do you need city name information?
    Do you need county information?
    Do you need a nearest dealer locator system?

    We can HELP! We have affordable AS/400 software and data to do all of the above. Whether you need a simple city name retrieval system or a sophisticated CASS postal coding system, we have it for you!

    The ZIP/CITY system is based on 5-digit ZIP Codes. You can retrieve city names, state names, county names, area codes, time zones, latitude, longitude, and more just by knowing the ZIP Code. We supply information on all the latest area code changes. A nearest dealer locator function is also included. ZIP/CITY includes software, data, monthly updates, and unlimited support. The cost is $495 per year.

    PER/ZIP4 is a sophisticated CASS certified postal coding system for assigning ZIP Codes, ZIP+4, carrier route, and delivery point codes. PER/ZIP4 also provides county names and FIPS codes. PER/ZIP4 can be used interactively, in batch, and with callable programs. PER/ZIP4 includes software, data, monthly updates, and unlimited support. The cost is $3,900 for the first year, and $1,950 for renewal.

    Just call us and we’ll arrange for 30 days FREE use of either ZIP/CITY or PER/ZIP4.

    WorksRight Software, Inc.
    Phone: 601-856-8337
    Fax: 601-856-9432
    Email: software@worksright.com
    Website: www.worksright.com

    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

  • Liam Allan Shares What’s Coming Next With Code For IBM i
  • From Stable To Scalable: Visual LANSA 16 Powers IBM i Growth – Launching July 8
  • VS Code Will Be The Heart Of The Modern IBM i Platform
  • The AS/400: A 37-Year-Old Dog That Loves To Learn New Tricks
  • IBM i PTF Guide, Volume 27, Number 25
  • Meet The Next Gen Of IBMers Helping To Build IBM i
  • Looks Like IBM Is Building A Linux-Like PASE For IBM i After All
  • Will Independent IBM i Clouds Survive PowerVS?
  • Now, IBM Is Jacking Up Hardware Maintenance Prices
  • IBM i PTF Guide, Volume 27, Number 24

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