How can I save and restore spool file data as part of my backup/recovery process?

Search400.com expert Ken Graap explains how to save and restore spool file data as part of a backup/recovery process.

How can I save and restore spool file data as part of my backup/recovery process?

i5/OS spool support is just a collection files, members and data records. Output queues contain spool file entries that are pointers to this file system. Therefore, spool files are not individual objects that can be saved like other objects on the system. Any save/restore process prior to V5R4 of OS/400 is unable to restore spool file data and maintain the original user job attributes. Once a spool file is restored, the original user won't be able to access it using the WRKSPLF *CURRENT command.

IBM's BRMS product has implemented a solution that allows you to archive spool file data, search for these archived spool files based on several spool file attributes and recreate the spool file.


Work with Saved Spooled Files (WRKSPLFBRM)

Type choices, press Enter.

Output queue . . . . . . . . . . OUTQ           *ALL               
  Library  . . . . . . . . . . .                  *ALL             
Auxiliary storage pool . . . . . ASP            *ALL               
File . . . . . . . . . . . . . . FILE           *ALL               
Job name . . . . . . . . . . . . JOB            *ALL               
User . . . . . . . . . . . . . . USER           *ALL               
User data  . . . . . . . . . . . USRDTA         *ALL               
Select dates:                    SLTDATE                           
  From date  . . . . . . . . . .                *BEGIN             
  To date  . . . . . . . . . . .                *END               
Save status  . . . . . . . . . . SAVSTS         *ALL               
Sequence option  . . . . . . . . SORT           *DATE              
From system  . . . . . . . . . . FROMSYS        *LCL               
Output . . . . . . . . . . . . . OUTPUT         * 

Again, this archive is just a 'copy' of the spool files data along with certain format related attributes. Any restore (actually recreation) of the spool file will still result in the loss of original job related attributes.

The latest release of OS/400 (V5R4) does contain a new feature that allows you to save an *OUTQ and the spool file data referenced by it. This new functionality has also been integrated into the latest release of BRMS. This native operating system enhancement only allows saves of entire output queues and can't be used to save individual spool files. Again the BRMS product comes to the rescue. Even though you can only save whole output queues, BRMS provides an interface that lets you find and restore individual spool files back into the same output queue they were saved from. Along with the new spool file save capability there are a couple of new printer file attributes:

Expiration date for file (EXPDATE) 

Specifies the expiration date for the spooled file. The spooled file will expire at 23:59:59, system local time on the date specified.


The expiration date does not change.


No expiration date is specified.


The expiration date is to be calculated using the value specified for the


Specify the date after which the spooled file will be eligible for removal from the system by the Delete Expired Spooled Files (DLTEXPSPLF) command. The date must be enclosed in apostrophes if date separator characters are used in the value.

Days until file expires (DAYS) 

Specifies the number of days to keep the spooled file.

Note: A value must be specified for this parameter if the Expiration date for file (EXPDATE) parameter has a value of *DAYS. If the EXPDATE parameter has a value other than *DAYS, no value is allowed for this parameter.


Specify an interval in days after which the spooled file will be eligible for removal from the system by the Delete Expired Spooled Files (DLTEXPSPLF) command. The actual expiration date applied to the spooled file is calculated by adding the number of days specified to the date this command is executed.

The DLTEXPSPLF command has been added to V5R4. It will evaluate the spool files on the system and delete them when they have expired.

The following command can be used to create a job schedule entry which causes the DLTEXPSPLF command to delete all expired spooled files on your system every day:


It took 30 years, but IBM finally has the System Administrator in a good way to manage system spool files. Good job IBM!

How do I know if I have completely saved my system?

There is a great toolset available for purchase called TAATOOL. It contains a command called CHKSAV that will check to see if you have saved all the libraries on your system! If you aren't able to acquire this set of tools, you could create something that might suffice using the DSPOBJD command to display information for all the libraries on your system to an OUTFILE and then query this file for "SAVE Date / SAVE Time / SAVE Command" etc...


runqry *none xx

You will then see all the information available to you. You will probably want to select the following fields for a report:

Display   Display   Object    Object
Date      Time                Type  
051605    111141    MyLib     *LIB 
Save      Save      Save      Save     Saved 
Date      Time      Command   Device   Volume
051505    212320    SAVLIB    Tape     E00140

Your auditors will then be able to see when each library on your system was saved, which SAV command was used and what tape volume this library was saved to. Of course, my favorite backup/recovery product IBM's BRMS, provides a set of comprehensive reports that show what is saved but more importantly what hasn't been saved on your system. Along with these reports is the system recovery report that provides step-by-step instructions on how to completely recover your system in the event of a catastrophic disaster.

This was last published in July 2006

Dig Deeper on Data backup, storage and retrieval on iSeries

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.