there are several ways to do this
easiest and cheapest is to CPYSPLF to a database file, this can then be processed by any in-house program, the disadvantage of this method is it only really works well for SCS prints and does not save spool file attributes
there are several tools (both IBM and 3rd party) on the market that allow for spool file management, some of the third party ones are quite good, and relatively inexpensive
if you wish to code in house then I have used the IBM QSPGETF Api several times in the past – but be warned – this is an undocumented/unsupported IBM internal API and is therefore subject to change without notice
From the V6R1 Memo to Users:<ul>
<li>With the introduction of operating system save and restore support for spooled files, the QSPGETF and QSPPUTF programs are no longer needed. Program QSPGETF has been removed.</li>
Saving/restoring spooled files is introduced in V5R4, so QSPGETF shouldn’t be a loss. But “backing up” spooled files is a questionable practice at best. They shouldn’t need backing up. They should only need to be respooled from original data.
Also, without OS support to enforce attributes such as creator, timestamps, etc., the copied spooled files are merely copies rather than backups. There is no assurance that alterations were not introduced, accidentally or otherwise. Obviously, audit trails are broken.