The section below describes how to save an IBM i spooled file with InterFormNG2. For a proof of concept we might ask you for a copy of a sample spooled file. This should not be confused with a text file with the same contents as the spooled file.
The procedure below explains how you can save a spooled file into a save file and how to download the save file on a PC.
(A prerequisite is, that the IBM i machine is running V5R4 or newer)
You can save a spooled file in this way:
1.Create a new output queue, to put the spooled files, that you want to save. You can e.g. do that with the command: CRTOUTQ QUSRSYS/SAVOUTQ
2.Move all the spooled files, that you want to save into a specific output queue. All spooled files on this output queue will be saved during the process, so it is a good idea to either create a new, temporary output queue or to delete/move any spooled files from this output queue, that you do not want to save. In the commands below I refer to the output queue as SAVOUTQ and the library of the output queue is QUSRSYS.
3.Now create a save file, that should be used for the saved output queue. The save file can e.g. be created in QGPL with this command: CRTSAVF FILE(QGPL/SAVFOUTQ)
4.Now we can save the output queue (including any spooled files inside) in this save file with this command: SAVOBJ OBJ(SAVOUTQ) LIB(QUSRSYS) DEV(*SAVF) SAVF(QGPL/SAVFOUTQ) SPLFDTA(*ALL) TGTRLS(V7R1M0) You need to remember SPLFDTA(*ALL) - if you forget, no spooled files will be saved. You could also consider to specify the target release in TGTRLS, to make it possible to restore the save file on an earlier OS400 version, than the one you are saving on. In the command above I select V7R1M0 as the target release, but in general you should to use the earliest target version possible.
5.If you want to send the save file to someone else (e.g. to InterForm A/S or one of our business partners), then you can copy the file to the IFS with this command: CPYTOSTMF FROMMBR('/qsys.lib/qgpl.lib/savfoutq.file') TOSTMF('/tmp/savoutq.savf') STMFOPT(*REPLACE) CVTDTA(*NONE). The TOSTMF is the destination stream file, you can of course choose another path and/or stream file name. You can copy the stream file to a PC e.g. for emailing via a mapped drive or via System i Navigator. (You can also chose to FTP (binary) the file directly from QGPL).
6.When you are done, you can delete the temporary save file in QGPL with this command: DLTF FILE(QGPL/SAVFOUTQ)and also delete the temporary file in the IFS: /tmp/savoutq.savf.
7.You can also consider to move the saved spooled files back to the original output queue (or delete them) and then delete the temporary output queue with the command: DLTOUTQ QUSRSYS/SAVOUTQ (You need to remove/delete the spooled files on that output queue before you can delete it).