The IFORMNG/CVTPRTFXML command is essential in Spool2XML as this command is able to generate an new printer file (that generates a special XML spooled file) based on a normal printer file.
The XML spooled file will contain a subtree for each record format and each field inside the record format will be represented by a node in this subtree. Any constants in the printer file will be ignored.
The new XML printer file will for the printing program look EXACTLY as the original so no level check error will be issued when putting this into production.
The command looks like this:
Convert Printer File to XML (CVTPRTFXML)
Type choices, press Enter.
From file . . . . . . . . . . . FROMFILE > NG402PR Name Library . . . . . . . . . . . > KSE Name, *LIBL To file . . . . . . . . . . . . TOFILE > NG402PR Name, *FROMFILE Library . . . . . . . . . . . > KSE_HIGH Name Printer file output queue . . . OUTQ *JOB Name, *JOB Library . . . . . . . . . . . Name, *LIBL Include comments . . . . . . . . INCCOMMENT *YES *YES, *NO New page format(s) . . . . . . . NEWPAGFMT *AUTO Name, *AUTO, *FIRST, *ALL + for more values Reuse XML-definition file . . . REFFILE Library . . . . . . . . . . .
Bottom F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display F24=More keys
|
The fields are these:
FROMFILE
The original printer file, that should be converted.
TOFILE
The name (and library) of the new XML printer file, that is the result of the conversion. You should specify the same name for the printer as the from file above - but use a different library. It is recommended to place the new printer file in another library than the original, so that you can later select between the original and the converted printer file by changing the library list for the relevant job.
OUTQ
The output queue of the new XML printer file. As default this will be *JOB. After the conversion the new XML printer file has been created and a new XML definition is
also added. You can now edit the preferences for the conversion into XML in the XML definition.
INCOMMENT
Here you can state if the comments from the printer file should also be included in the output XML spooled file.
REFFILE
If you are going to convert a printer file, that is very similar to a printer file, that has previously been converted (and has been setup with e.g. parent/child definitions), then you can here refer to the existing, converted printer file, that is registered as an XML definition in option 2 of the IFORMNG2/IFORMNG2 menu. If you refer to such a printer file, then all definitions are copied for the matching printer file formats and fields. In this way you can reuse as much of the old definitions as possible.