You are currently on IBM Systems Media’s archival website. Click here to view our new website.

Bookmark and Share

Recent Posts

Working With Your Spooled Output

August 3, 2011

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 Information 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 Information 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.








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 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



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



Element 2: End time and date

Element list



Element 1: Ending time

Time, *AVAIL



Element 2: Ending date

Date, *END



ASP device


Added in V5R3 for IASP Support






Display format




Assistance level




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.




Posted August 3, 2011| Permalink