IBM Support

QSPL Physical File Damage

Troubleshooting


Problem

Occasionally, one of the physical files, or members of the physical files in library QSPL can become damaged. The names of physical files begin with Q04079N or Q00512N. Each of the physical files have members.  Each member contains the data of a spooled file on an output queue.  The spooled file on the output queue is a pointer to the member in the physical file in QSPL library.  When one of the physical files or members become damaged, the job, or possibly the system may not be able to create any additional spooled files.  This can be a severe impact.
 
Caution: When experiencing issues with damaged files in the QSPL library it is highly recommended to discuss the issue with an IBM support representative before following the instructions in this document. These procedures should only be done by an experienced system administrator or operator. Failure to heed this warning could result in the wrong physical files being deleted.

Note: Any spooled files that is included in a damaged physical file in library QSPL will be lost. If the spooled file data for those spooled files has already been saved, then it can be restored after recovery. For information on saving and restoring spooled files, refer to Saving and Restoring Spooled Files.

Symptom

Messages that have been reported due to a damaged physical file or member of a physical file in library QSPL:
CPF4182:  File <PrinterFileName> in library <LibraryName> member or device not opened.  
Previous messages might include message 
CPF9845: Error occurred while opening file <PrinterFileName>. 
CPF2528:  Job log not written to output queue because of CPF4182.
CPF3207:  Member not added. Errors occurred.
CPF3213:  Members for file <PhysicalFileName> more than maximum allowed.
CPF5257:  Failure for device or member *N file <PrinterFileName> in library <LibraryName>.
CPF0937:  Machine check not recoverable.  Error code X'0000'.
CPF4510:  File <PrinterFileName> in library <LibraryName> member or device *N was not closed.
RNQ1217:  Error message <ErrorMessage> appeared during <OPEN or CLOSE> (C G D F)
MCH3202:  Permanent machine error <ErrorID>. Internal dump identifier (ID) <DumpID>.
MCH3203:  Function error <ErrorID> in machine instruction. Internal dump identifier (ID) <DumpID>.    
Messages seen in QSPLMAINT job log:
MCH1604:  System object <PhysicalFileName><MemberName> damaged. Internal dump ID <DumpID>. Error class 2, device number X'00A0'.       
**NOTE:  The error class and device number may vary.
CPF8118:  Full damage on spooled file <PhysicalFileName>member <MemberName>. 
CPF9999:  Function check. CPF8118 unmonitored by QSPRESET at statement *N, instruction X'019A'.
**NOTE:  Instruction may vary.
MCH3402:  Tried to refer to all or part of an object that no longer exists.
CPF3272:  Damage ignored for file <PhysicalFileName> in QSPL.

Cause

A physical file or member of a physical file in library QSPL is damaged.  This can happen when the system ends abnormally.  Other known causes include an application changing members in the physical files or any other manual manipulation on the physical files or members in QSPL library.
For more information on how spooled files are stored and how to find a damaged QSPL physical file or member, a video is available to help you understand how spooled files are stored. The video does not guide you though the steps that you need to take to repair damage, but is meant more as a guide to help you better understand how spooled files are stored so that you can use this document to guide your steps to repairing any damage that exists.

Environment

This can occur on any release of IBM i.

Resolving The Problem

There are some temporary circumventions that may allow spooled files to be created. Ultimately, the physical file will have to be deleted, losing all spooled files that happen to be stored in the file.  Depending on the extent of damage, the entire QSPL library may need to be recreated, losing all spooled files on the system.  If the spooled file data has been previously saved, the files can be restored after the recovery.
Temporary Circumventions
These are some options that can be done as a temporary work-around to reduce the risk of losing more spooled files when the QSPL indexes are cleaned up.
 
Note: Some of these options require you to know the name of the damaged QSPL physical file, or the damaged member of that file. To find which QSPL physical files or members actually have damage, you will need to know and be able to display a spooled file which you know is damaged. If you can do this, open up a second display session, and do a WRKJOB on the job that is displaying the spooled file. Then use option 12 to Work with Locks, and you will find an object lock on an object like Q04079Nxxx, and will be able to take a 5 on it to see the member lock. If you cannot find the damaged QSPL file or member, use the other options to reduce the possibility of creating spooled files which may be lost during cleanup.
o
End and restart the job.
The internal algorithm used to determine which physical file the spooled file data is stored in involves the job number.  By ending and restarting the job, a different job number is assigned and a different, non-damaged physical file may be selected.
o
If the damaged member name is known, use the Remove Member (RMVM) command to remove the damaged member from the physical file:

RMVM FILE(QSPL/Q04079Nxxx) MBR(member-name)
o
If the name of the damaged physical file in QSPL library is known, change the Maximum members parameter for the physical file to the current total number of members so the physical file cannot be used.
Note: Setting the Maximum members (MAXMBRS) parameter should force the use of another physical file in QSPL library, but may result in jobs receiving message CPF3213:  Members for file &1 more than maximum allowed, and CPF3207:  Member not added. Errors occurred.
DSPFD FILE(QSPL/Q04079Nxxx) TYPE(*MBRLIST) OUTPUT(*)
Type B in the Control field and press <ENTER>
Note the Total number of members value
CHGPF FILE(QSPL/Q04079Nxxx) MAXMBRS(# of current members)
 
o
If the damaged physical file name starts with Q04079N, force the system to use the Q00512N physical files.

CHGPRTF FILE(*ALL/*ALL) DFRWRT(*NO) SCHEDULE(*IMMED)
By changing the printer files on the system to Defer write *NO and Spooled output schedule to *IMMED, the spooled file data will be stored in the physical files that begin with Q00512N.  The 512 refers to the record size of the physical file, and a fixed portion of the record is used by system for record-keeping. Therefore, using a 512 record length is not quite as space-efficient as a 4079 record length; however, it will circumvent the issue until the damaged can be corrected.
Note:  Once the damage has been corrected, the printer files should be changed back to their default settings:
CHGPRTF FILE(*ALL/*ALL) DFRWRT(*YES) SCHEDULE(*FILEEND)
o
**Use only as a last resort.**
Reclaim all unused members in the physical files in QSPL library.  This may reclaim some of the members that are causing the issue.
WARNING:  Performing this step can cause severe spooling performance delays as it removes all unused members from the physical files in QSPL library.  Reusing members to store the spooled file data is much faster than having to create a new member.  This option should only be considered if creating spooled files is more important than performance.

RCLSPLSTG DAYS(*NONE)
 

 
Re-creating the Damaged Physical File
The final solution will involve deleting the physical file that is damaged. There is no way to fix the damage. All spooled files that happen to be stored in that physical file will be lost.  There is no way to determine which spooled files are stored in the damaged physical file. If there are any important spooled files, they should be saved before performing these actions.

The first method of re-creating the damaged physical file is to delete the damaged database file in QSPL, end all of the writers, clean up the QSPL database, create a special data area called QSPLDTAARA, IPL the system, and then delete the QSPLDTAARA data area. 
1.
Delete the damaged physical file:

DLTF FILE(QSPL/Q04079Nxxx)
Where Q04079Nxxx represents the name of the damaged physical file in the QSPL library.
Note: This step is optional, and will need to be skipped, if the damaged QSPL physical file is not known. And as deleting the file will cause the loss of all spooled files stored in it, it is considered unnecessarily harmful if a recent save of spooled files has not been performed.
2.
End all of the writers on the system, or end the QSPL subsystem.
NOTE:  Do one or the other, not both.
ENDWTR WTR(*ALL) OPTION(*IMMED)
-or-
ENDSBS SBS(QSPL) OPTION(*IMMED)
3.
Clean up the QSPL database by using the Start Spool Reclaim (STRSPLRCL) command for all output queues:

STRSPLRCL OUTQ(*ALL) ASPGRP(*)
4.
IPL the system with the QSPLDTAARA data area in place:
Create the data area:
   CRTDTAARA DTAARA(QSPL/QSPLDTAARA) TYPE(*CHAR) LEN(3) VALUE(YYN) AUT(*ALL)
IPL the system:
   PWRDWNSYS OPTION(*IMMED) RESTART(*YES) IPLSRC(B)
After the IPL, delete the data area:
   DLTDTAARA DTAARA(QSPL/QSPLDTAARA)
5.
If the temporary work around to change all printer files to use the Q00512Nxxx database files in QSPL, run the following command to return the printer files to the default setting.
CHGPRTF FILE(*ALL/*ALL) DFRWRT(*YES) SCHEDULE(*FILEEND)

Rebuilding the QSPL Library
If QSPL library itself is damaged, the following instructions will not work.  Refer to QSPL Library Damage.
If problems persist, the ultimate solution is to rebuild QSPL library.  This involves putting the system into a restricted state, rename QSPL library to QSPL2 as you cannot delete a system supplied library, delete QSPL2 library, and perform a clear/clear/clear IPL.
WARNING:  All spooled files will be lost.
1.
Put the system to restricted state:
ENDSBS SBS(*ALL) OPTION(*CNTRLD) DELAY(600)
2.
Rename the QSPL library to QSPL2:

RNMOBJ OBJ(QSPL) OBJTYPE(*LIB) NEWOBJ(QSPL2)
3.
Delete the QSPL2 library:

DLTLIB LIB(QSPL2)
4.
Change the IPL attributes to clear the job queues, output queues, and incomplete job logs and change the Spooled File Recovery to *REMOVE:
CHGIPLA SPLFRCY(*REMOVE) CLRJOBQ(*YES) CLROUTQ(*YES) CLRINCJOB(*YES)
5.
Immediately do a MANUAL IPL.
When presented with the IPL Options screen, verify Clear job queues, Clear output queues, and Clear incomplete job logs is set to Y and Spooled File Recovery is *REMOVE.  If not, change them accordingly.
NOTE:  After the IPL, change the IPL attributes back to Spooled File Recovery as *DETACH.
6.
Once the IPL completes, QSPL library will have been rebuilt and there should not be any errors when generating spooled files.
7.
Change the IPL attributes and printer files again to the initial settings:
CHGIPLA SPLFRCY(*REMOVE)
CHGPRTF FILE(*ALL/*ALL) DFRWRT(*YES) SCHEDULE(*FILEEND)

[{"Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000CPJAA2","label":"Print-\u003ESpooled Files QSPL Library"}],"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Version(s)"}]

Historical Number

16100118

Document Information

Modified date:
15 February 2024

UID

nas8N1019624