iCan Blog Archive

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?!)

   |          .-*CURRENT--.  .-*ALL--------.  .-*ALL------.  .-*ALL------.  .-*ALL-------.    |
              '-user-name-'  '-device-name-'  '-form-type-'
   |          .-*INLENV-.    |
   |          .-*PRV------.    |  |          .-*------.    |
   '-ASTLVL(--+-*USRPRF---+--)-'  '-OUTPUT(--+-*PRINT-+--)-'

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.

SELECTSelect files forElement list 
 Element 1: UserGeneric name, name*CURRENT, *ALLGeneric name support added in 5.4
 Element 2: Print deviceName*ALL, *OUTQ 
 Element 3: Form typeCharacter value*ALL, *STD 
 Element 4: User dataCharacter value*ALLGeneric support added in 5.4
 Element 5: ASP1-32, *ALL, *ASPDEV*ASPDEV added, extended to 32 in V5R3 for IASP support
 Element 6: Spooled fileGeneric name, name*ALLAdded in 5.4
JOBJob nameSingle values: *ALL
Other values: Qualified job name
Added in 5.4
 Qualifier 1: Job nameGeneric name, name 
 Qualifier 2: UserGeneric name, name*ALL 
 Qualifier 3: Number000000-999999, *ALL 
PERIODTime periodElement listAdded in 5.4
 Element 1: Start time and dateElement list 
 Element 1: Beginning timeTime*AVAIL 
 Element 2: Beginning dateDate*BEGIN, *CURRENT *CURRENT added in 7.3
 Element 2: End time and dateElement list 
 Element 1: Ending timeTime*AVAIL 
 Element 2: Ending dateDate*END 
ASPDEVASP deviceName*, *SYSBAS, *CURASPGRPAdded in V5R3 for IASP Support
DSPFMTDisplay format*INLENV, *S36FMT, *NORMAL 

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.