In recent blog articles I wrote about Job Log Pending and the Job Log Output attribute that can be used to prevent the generation of spooled job logs. In addition, in a prior blog, I also wrote how to Detach Spooled Files from a job.
These all can be very helpful features, but one common concern I hear when I discuss these configuration options with clients is how to find their spooled files and job logs. Taking advantage of these features means you will likely need to change your approach to finding spooled files, but the capability to do so has been built into the operating system.
Everyone who has been using IBM i’s character-based user interface (the “green screen”) is familiar with the Work with Spooled Files (WRKSPLF) command. This command has been part of the operating system “forever.” However, when a function is part of the base operating system, we don’t always realize enhancements have been added because IBM always does it in a way that is upwardly compatible. That is, you can keep on using WRKSPLF just as you always have and not even realize that new features are available. And IBM does not change-flag enhancements to CL commands in the Knowledge Center, which makes it all the harder to know what has changed. And the IBMers that talk about the latest and greatest additions to the operating system generally don’t get too excited about incremental enhancements to that “old stuff”…. So while WRKSPLF command has been around “forever” and although the major enhancements were made to it in 5.4 (a “long” time ago), I’ve discovered that many people are still not aware of these changes.
As a quick exercise, let’s look at the command parameters between V5R2 and 7.1.
Here is the Work with Spooled Files Command syntax diagram from the V5R2 Information Center (remember those?!)
>>-WRKSPLF------------------------------------------------------>
>--+-----------------------------------------------------------------+-->
| .-*CURRENT--. .-*ALL--------. .-*ALL------. .-*ALL------. .-*ALL-------. |
'-SELECT(--+-*ALL------+--+-*OUTQ-------+--+-*STD------+--+-user-data-+--+-ASP-number-+--)-'
'-user-name-' '-device-name-' '-form-type-'
(1)
>--+-------------------------+---------------------------------->
| .-*INLENV-. |
'-DSPFMT(--+-*S36FMT-+--)-'
'-*NORMAL-'
>--+---------------------------+--+------------------------+---><
| .-*PRV------. | | .-*------. |
'-ASTLVL(--+-*USRPRF---+--)-' '-OUTPUT(--+-*PRINT-+--)-'
+-*BASIC----+
'-*INTERMED-'
Below are the Work with Spooled Files Command parameters from the 7.1 Knowledge Center, but I’ve changed the Notes column to identify changes to the WRKSPLF command. You’ll observe that major changes were done in the 5.4 release.
Keyword | Description | Choices | Notes |
SELECT | Select files for | Element list | |
Element 1: User | Generic name, name, *CURRENT, *ALL | Generic name support added in 5.4 | |
Element 2: Print device | Name, *ALL, *OUTQ | ||
Element 3: Form type | Character value, *ALL, *STD | ||
Element 4: User data | Character value, *ALL | Generic support added in 5.4 | |
Element 5: ASP | 1-32, *ALL, *ASPDEV | *ASPDEV added, extended to 32 in V5R3 for IASP support | |
Element 6: Spooled file | Generic name, name, *ALL | Added in 5.4 | |
JOB | Job name | Single values: *ALL Other values: Qualified job name | Added in 5.4 |
Qualifier 1: Job name | Generic name, name | ||
Qualifier 2: User | Generic name, name, *ALL | ||
Qualifier 3: Number | 000000-999999, *ALL | ||
PERIOD | Time period | Element list | Added in 5.4 |
Element 1: Start time and date | Element list | ||
Element 1: Beginning time | Time, *AVAIL | ||
Element 2: Beginning date | Date, *BEGIN, *CURRENT | *CURRENT added in 7.3 | |
Element 2: End time and date | Element list | ||
Element 1: Ending time | Time, *AVAIL | ||
Element 2: Ending date | Date, *END | ||
ASPDEV | ASP device | Name, *, *SYSBAS, *CURASPGRP | Added in V5R3 for IASP Support |
OUTPUT | Output | ||
DSPFMT | Display format | *INLENV, *S36FMT, *NORMAL | |
ASTLVL | Assistance level | *PRV, *USRPRF, *BASIC, *INTERMED |
How can these additional parameters help you?
You can use the WRKSPLF command to list spooled files by their file type – e.g., on the command prompt if you type QPJOB* for the Spooled File element on the SELECT parameter, you will display all the spooled files that begin with QPJOB* for your user profile (i.e., all your spooled job logs).
You can use the WRKSPLF command with the JOB parameter to work with the spooled files for a specific job or a generic job specification. For example, if you are detaching spooled files from their jobs, you can use the JOB parameter on the WRKSPLF command to locate the spooled files, even through the job is no longer in the system. Note the JOB parameter requires the USER element of the SELECT parameter to be *ALL.
You can use the WRKSPLF command with the PERIOD parameter to find spooled files from a specific timeframe. You can combine the JOB and PERIOD parameters to further refine the search criteria on which spooled files you are looking for.
And remember, too, that the Work with Job Logs (WRKJOBLOG) command was also added in the 5.4 release to make finding and working with spooled and pending job logs easier.
This blog post was originally published on IBMSystemsMag.com and is reproduced here by permission of IBM Systems Media.