Save a spooled file

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 you want to save a spooled file including all spooled file attributes in a save file in the IFS, then you need to get to a command line in a 5250 session on the IBM i.

Here you can use the command:

IFORMNG2/SAVSPLF

 

The spooled file can be restored with the IFORMNG2/RSTSPLF command.

 

If you prompt the command with F4, then you are able to see all the parameters of the command:

                      Save splf to stream file (SAVSPLF)

Type choices, press Enter.

 Spooled file  . . . . . . . . . . . . . . . FILE         QSYSPRT       Name
 Job name  . . . . . . . . . . . . . . . . . JOB          *             Name, *
   User  . . . . . . . . . . . . . . . . . .                              Name
   Number  . . . . . . . . . . . . . . . . .                              000000-999999
 Spooled file number  . . . . . . . . . . . SPLNBR       *LAST         1-9999, *ONLY, *LAST
 Job system name  . . . . . . . . . . . . . JOBSYSNAME   *ONLY         Name, *ONLY
 Spooled file created:                      CRTDATE
   Creation date  . . . . . . . . . . . . .                *ONLY         Date, *ONLY
   Creation time  . . . . . . . . . . . . .                              Time, *ONLY
 To stream file  . . . . . . . . . . . . . . TOSTMF       /IFORMNG2/Screenshot.if1_

 F3=Exit   F4=Prompt   F5=Refresh   F12=Cancel   F13=How to use this display

 F24=More keys
                                                                         Bottom

The parameters are:
  1. Spooled file
    The name of the spooled file, that you want to save.
  2. Job name
    The name of the job, that created the spooled file. Here you can use * to refer to the current job name, user and job number.
  3. User
    The user, that created the spooled file.
  4. Number
    The job number of the job, that created the spooled file.
  5. Spooled file number
    Here you can state the spooled file number as a specific number or either the only or last spooled file, that was created by the job selected above.
    If you e.g. have selected the current job with *, then you can use the *LAST value to select the last spooled file with the specified name, that was generated by the current job.
  6. Job system name
    The name of the system (IBM i), where the spooled file was generated. Normally the default value *ONLY can be used. You only need to specify the name, if there are multiple spooled files with the same name, job and spooled file number, so that those cannot uniquely identify a spooled file.
  7. Creation date
    The date when the spooled file was created. The use is for the same as the job system name.
  8. Creation time
    The time when the spooled file was created. The use is for the same as the job system name.
  9. To stream file
    The path and name of the stream file to be created. If the stream file already exist, then the command will fail with the error:
    CPA0A0: Object already exists.  Object is /iformng2/screenshot.if1. You can decide yourself for the extension of the stream file. In the example above the extension .if1 is used as this is the extension used by InterForm400.

Below a couple of examples illustrate how you can save a spooled file with this command.

Example1

One challenge when you use the command

IFORMNG2/SAVSPLF
 is the identification of the spooled file i.e. the spooled file name, the job and the spooled file name. There is however a trick to get those identifiers for a spooled file.

 

To get them you can e.g. use the OS400 command, WRKSPLF and then select the spooled file with e.g. option 1. Do not press Enter, but press F4 instead. Then press F14. Now you can see the spooled file identification like below:

 

NG2PromptSplfID0001

 

Then you select the spooled file identification with the mouse like shown with the yellow frame above, and copy this to the clip board (e.g. with <CTRL> + C).

Now press F12 to get back to the command line and run this command to get multiple entry lines:

CALL QCMD

Now press F11 to get a full screen of entry lines.

Now type in the command

IFORMNG2/SAVSPLF
 in the top of the screen and then paste the clip board contents next to the command like below:

 

NG2PromptSplfID0002

 

Now press F4 to prompt the command and fill out the output stream file:

(You can ignore the warning in the bottom of the screen)

 

NG2PromptSplfID0003

 

Finally you can press Enter to save the spooled file.

Example2

Here is a less technical description of how to identify the spooled file identification:

 

First identify the output queue on which the spooled file is placed. Run the command: WRKOUTQ with the output queue a parameter e.g.

WRKOUTQ PRT01

 

This will result in a spooled file list like below:

 

NG2SaveSplf0004

 

If you press the F11 key once, then you can see the parameters required for the SAVSPLF command in the first 5 columns:

 

NG2SaveSplf0005

 

If you here e.g. want to save the first spooled file, then you can do that with this command:

 

NG2SaveSplf0006

 

A prerequisite for just specifying the first 5 parameters is, that they are enough to uniquely identify the spooled file, which they normally are.

 

 



    • Related Articles

    • 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 ...
    • 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 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 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 ...
    • Restore a spooled file

      With InterFormNG2 you restore a spooled file in two manners: You can download a loaded spooled file from the InterFormNG2 library, and upload it into the library (same procedure as an XML file) of another InterFormNG2 installation e.g. on a windows ...