CPF
CPF4128 Cannot allocate the file for open
Most common cause
Another job holds a lock on the file that conflicts with the open: CLRPFM, RGZPFM, ALCOBJ *EXCL, a save or a CHGPF in progress.
Other causes
- A restore or a copy with replace running on the file.
- The file wait time (WAITFILE) is shorter than the lock.
- For a printer or display file: the device is not varied on, or is allocated to another job, for example a print writer. WRKCFGSTS *DEV shows it.
How to fix it
Find who holds the lock with WRKOBJLCK OBJ(LIB/FILE) OBJTYPE(*FILE). Wait for or end the blocking job, and move exclusive operations out of working hours. If the lock is short, raise WAITFILE with CHGPF or OVRDBF.