Save a spooled file without InterFormNG2

Save a spooled file without InterFormNG2

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).

    • Related Articles

    • Save a spooled file

      You can save a spooled file with InterFormNG2 in three manners: 1.Save spooled file as InterFormNG2 document. 2.Save a spooled file without InterFormNG2 3.Save a spooled file into a save file with InterFormNG2 The third option is covered below. If ...
    • Save a printer file

      For support cases it can sometimes be required, that you include a saved printer file, that is used by the Spool2XML module. This would normally be the converted (XML) printer file, which will make the printing application generate 'XML like' spooled ...
    • Spooled file formats

      Whenever you load or process spooled files in InterFormNG2, then you can choose between two internal formats: Version 1.0 and version 2.0. It is recommended to use Version 2.0 if at all possible. These are the reasons why you should use the version ...
    • Spooled file support

      InterFormNG2 is able to process spooled files, if you install InterFormNG2 on the IBM i platform. Please notice, that spooled file support, as well as Spool2XML, are modules for InterFormNG2, that are purchased separately. You can also use the ...
    • Spooled file split

      You might want to split up spooled files during InterFormNG2 processing. The reason might be, that the input spooled file may contain multiple documents (e.g. invoices), and that you want to create one PDF file (or email) for each invoice. There are ...