Please enable JavaScript to view this site.

InterFormNG Manual 2020

The XML definitions can be created in two manners:

 

1. Via the command: IFORMNG/CVTPRTFXML. This command creates a new (XML) printer file on the basis of the original printer file and sets an output queue for the new printer file.

This output queue should be a monitored output queue. This command is described here:

2. Via F6=Create on the 2. Work with XML definitions menu as shown below. This is normally NOT how an XML definition should be created. In short an XML definition is the ‘recipe’ of how the XML spooled file is to be converted into real XML file(s) and which InterFormNG template, that is used for the final merge(s) as well as on which output queue the final, merged spooled file is to be created.

 

This section e,g, covers:

 

1.The record format fragment option.

2.The unique record format option to delete duplicate record formats.

3.The fields including key fields, Top fields, delete fields and key field error messages.

4.Configuration of parent/child relationships.

5.Overview of all parent/child relationships.

 

 

This menu option gets to this screen:

 

 

          Work with xml definitions                                    XDF300D 

                                                                               

 Position to . . . . . .                Printer file                           

                                                                               

 Type options, press Enter.                                                    

   2=Change   3=Copy   4=Delete   5=Display   12=Record formats                

   14=Parent child relationship   15=Display keys   17=Export                  

                                                                               

 Opt  File        Library     Description                                      

 _    AM64MRP1    IFORMDEV    CVTPRTFXML                                       

      NG401PR     EXPORTID:1  CVTPRTFXML                                       

      NG401PR     EXPORTID:2  CVTPRTFXML                                       

      NG401PR     EXPORT0001  CVTPRTFXML                                       

      NG401PR     KSE_HIGH    CVTPRTFXML                                       

      NG401PR     KSE_HIGH¤   CVTPRTFXML                                       

      NG401PR     PRODNY      CVTPRTFXML                                       

      NG401PR     VERSION 2.  CVTPRTFXML                                       

                                                                               

                                                                               

                                                                               

                                                                               

                                                                           End 

 F3=Exit   F5=Refresh   F6=Create   F8=Import   F11=View 2   F12=Cancel        

                                                                             

 

When you create or edit a new XML definition this screen is shown:

 

 

          Change xml definition                                        XDF310D 

                                                                               

 Printer file . . . . . . :   AM64MRP1                                         

   Library  . . . . . . . :     IFORMDEV     Name, *ALL                        

                                                                               

 Reference printer file . :   AM64MRP1                                         

   Reference library  . . :     AMALIBB                                        

                                                                               

 Description  . . . . . . .   CVTPRTFXML                                       

 Template . . . . . . . . .                                                    

                                                                               

 Create fragments . . . . .   3              0=Ignore fragment processing      

                                             1=Single fragments file           

                                             2=Multiple fragment files         

                                             3=Treebuilder                     

                                                                               

 Output queue . . . . . . .                                                    

   Library  . . . . . . . .                                                    

                                                                               

                                                                               

                                                                               

                                                                               

 F3=Exit   F12=Cancel                                                          

                                                                             

 

The fields are these:

 

Printer File

The printer file, that this XML definition is linked to/used for.

 

Library

The library of the printer file. State *ALL if the XML definition should be used for all printer files with this name above - independent of the library in which it is placed. (It can be that you have multiple, identical printer files in various libraries).

 

Reference Printer file and library

The original printer file from which the printer file above was created (with the CVTPRTFXML command). This information can be used if you would want to disable IFormNG/400 and use the original printer file again.

 

Description

A description of the XML definition. If the definition has been created by the CVTPRTFXML command, then the description will be set to CVTPRTFXML.

 

Template

The InterFormNG template (form) to be used when the XML file will merged (and printed) in InterFormNG.

 

Create fragments

Select if a level break of any defined key field(s) should trigger a new fragment or XML file as input for InterFormNG. The possibles values are:

0=Ignore fragment processing

Any defined fragment setting are ignored. The complete XML file is generated.

1=Single fragments file

This option runs like 2 below except that contents of all the files are placed in a single xml file with a common header that specifies the identification of the job,

spooled file etc. as IFormNG always generates. This value can e.g. be used to verify the structure of the output without the risk of generating a lot of (wrong?) XML files before changing into 2 as below.

2=Multiple fragment files

This splits up the result into multiple files depending on the level break (or change) of the key fields in the record format marked for fragmenting. Please notice, that any record formats, that are not marked as parent or child for the fragmented format will NOT be included in the result when using either 1=Single fragments file or 2=Multiple fragment files - which could e.g. be the

case of a front page of the original spooled file. If you want such record formats to be included you will need to select 0=Ignore fragment processing above.

3=Treebuilder

With this option you can build the XML tree of the output XML file in a totally different manner than for the other options. With this you specify a tree structure with a special Top node with a Top key field. With this you can eliminate any duplicates in the XML files and build a more efficient and compact XML file. Some prerequisites does apply.

 

Output queue

The output queue (and library) where the final print out (generated from InterFormNG) will be generated - unless it is overridden in the definition of the monitored output queue.

 

For the XML definitions these options are possible:

 

12=Record formats

With this option you can see a list of the formats defined in the specific printer file:

 

 

          Work with record formats                                     XDR300D  

                                                                                

 Printer file  . . . . :   AM64MRP1                                             

 Library . . . . . . . :   IFORMDEV                                             

                                                                                

 Type options, press Enter.                                                     

   2=Change   5=Display   12=Fields   14=Children                               

                                                                                

 Opt    Seq  Format      Description                                     Frg Unq

          1  P64M1010                                                           

          2  P64M1035                                                           

          3  P64M1040                                                           

          4  P64M1120                                                           

          5  P64M1130                                                           

          6  P64M1140                                                           

          7  P64M1HD1                                                           

          8  P64M1HD2                                                           

          9  P64M1170                                                           

         10  P64M1180                                                           

         11  P64M1190                                                           

         12  P64M1200                                                           

                                                                        More... 

 F3=Exit   F5=Refresh   F12=Cancel                                              

                                                                               

 

 

Record format fragment option

Each record format can be set to be either fragmented - indicated with a 'Y' in the Frg column or to be Unique (Ung). The unique option means, that only the first occurrence of a record format should appear in the output XML file, so you can use this to eliminate duplicates.

 

This is set via 2=Change on a record format above:

 

 

         Change record format                                         XDR310D  

                                                                                

 Printer file . . . . . . :   AM64MRP1                                          

 Library  . . . . . . . . :   IFORMDEV                                          

                                                                                

 Sequence . . . . . . . . :       8                                             

 Record format  . . . . . :   P64M1HD2                                          

                                                                                

 Description  . . . . . . .                                                     

                                                                                

 Fragment level . . . . . .   Y   Y=Yes, N=No                                   

                                                                                

 Format is unique . . . . .   Y   Y=Yes, N=No                                   

                                                                                

                                                                                

                                                                                

                                                                                

                                                                                

                                                                                

                                                                                

                                                                                

                                                                                

 F3=Exit   F12=Cancel                                                           

                                                                                

The fragment flag is used by the fragment options 0,1 and 2. It is ignored for fragment option 3.

It should normally be used with a key field.

 

 

 

Record format unique option

On the record formats inside the XML definitions you can with option 2=Change set a unique option on the record formats. This can be used for deleting duplicates of the record format in the XML. This option simply only keeps the first occurrence of the record format in the input spooled file, if activated. You activate it here:

 

 

         Change record format                                         XDR310D  

                                                                                

 Printer file . . . . . . :   AM64MRP1                                          

 Library  . . . . . . . . :   IFORMDEV                                          

                                                                                

 Sequence . . . . . . . . :       8                                             

 Record format  . . . . . :   P64M1HD2                                          

                                                                                

 Description  . . . . . . .                                                     

                                                                                

 Fragment level . . . . . .   Y   Y=Yes, N=No                                   

                                                                                

 Format is unique . . . . .   Y   Y=Yes, N=No                                   

                                                                                

                                                                                

                                                                                

                                                                                

                                                                                

                                                                                

                                                                                

                                                                                

                                                                                

 F3=Exit   F12=Cancel  

 

 

The unique option works for all fragment options.

 

 

 

12=Fields

For each format you can use option 12=Fields to view the list of fields for the specific format.

 

For each field you can even set these options:

 

 

         Work with fields                                             XDS300D 

                                                                               

 Printer file  . . . . :   AM64MRP1                                            

 Library . . . . . . . :   IFORMDEV                                            

 Record format . . . . :   P64M1HD2                                            

                                                                               

 Type options, press Enter.                                                    

   X=Key   D=Delete   T=Top   blank=Not a key field                            

                                                                               

 Key    Seq  Field name  Description                                           

          1  *IN68                                                             

          2  *IN08                                                             

          3  *IN26                                                             

          4  *IN39                                                             

          5  *IN60                                                             

          6  *IN84                                                             

  T       7  ORDNO                                                             

          8  REVNB                                                             

          9  SCDE1R                                                            

         10  VNAME1                                                            

         11  MNAME                                                             

                                                                        More...

 F3=Exit   F5=Refresh   F12=Cancel                                             

                                                                               

 

X=Key

For fragment 0,1 and 2 only. The field is set to be a key field for fragmentation (Fragment 1 or 2 only). If one of the key fields changes in the output, then this is considered a potential ‘level break’. So depending on the fragment setting of the XML definition, then a change of value for any of these fields may trigger a new XML file as output. If no keys are marked for a record format, which is set to trigger fragments, then a ‘level break’ will be triggered each time the format is written.

 

If you select field to be a key, then the record format must have the fragment option activate. If you do not activate the fragment option for the record format, then you will see this error in the joblog of the monitor job and as a message in the QSYSOPR message queue:

 

 

                         Additional Message Information                        

                                                                               

 Message ID . . . . . . :   NGE5012       Severity . . . . . . . :   00        

 Message type . . . . . :   Diagnostic                                         

 Date sent  . . . . . . :   02/04/20      Time sent  . . . . . . :   16:25:18  

                                                                               

 Message . . . . :   Key field ORDNO at format P64M1HD2 found outside fragment.

 Value '' not allowed outside a fragment.                                      

                                                                             

 

- followed by this message:

 

 

                         Additional Message Information                      

                                                                             

 Message ID . . . . . . :   NGE5005       Severity . . . . . . . :   00      

 Message type . . . . . :   Diagnostic                                       

 Date sent  . . . . . . :   02/04/20      Time sent  . . . . . . :   16:25:18

                                                                             

 Message . . . . :   Error converting spooled file AM64MRP1 to XML.          

 Error processing spooled file AM64MRP1 spooled file number 4 from job       

   220598/VICB/AMA0090864.                                                   

 See previous message in the *QSYSOPR message queue for more information.    

 

 

In case of these errors no XML file will be generated and processing of the XML spooled file will stop i.e. any spooled file action setup on the monitor job is not executed.

 

 

D=Delete

For fragmentation=3 only: This deletes/removes the field from the output XML file. Use this to reduce the size of the output XML e.g. for increased performance and to make the design process easier as the user will not need to scroll past a lot of fields, that really is not needed.

 

T=Top

For fragmentation=3 only: This indicates, that the record format should be used as the Top node i.e. that this should be used for collecting duplicates. Any record formats with the same value for the Top key is merged into one.

 

Setup parent/child relationships in XML

You can also use option 14=Children to set how the XML file is to be structured i.e. if one format should be a subtree (or child) to another in the output XML file. Use this option to set the child formats for this

record format:

 

In this case the P64M1200 format is set to be a child of the P64M1HD2 format:

 

 

          Work with child record formats                               XDC300D 

                                                                               

 Printer file  . . . . :   AM64MRP1                                            

 Library . . . . . . . :   IFORMDEV                                            

 Record format . . . . :   P64M1HD2                                            

                                                                               

 Type options, press Enter.                                                    

   X=Child   1=Single child   blank=Not a child format                         

                                                                               

 Child  Seq  Format      Description                                           

          1  P64M1010                                                          

          2  P64M1035                                                          

          3  P64M1040                                                          

          4  P64M1120                                                          

          5  P64M1130                                                          

          6  P64M1140                                                          

          7  P64M1HD1                                                          

          9  P64M1170                                                          

         10  P64M1180                                                          

         11  P64M1190                                                          

   X     12  P64M1200                                                          

                                                                        More...

 F3=Exit   F5=Refresh   F12=Cancel                                             

                                                                               

 

X=Child

This indicates, that the selected record format is be inserted as a child of the current record format.

 

1=Single child

This option is only supported for the fragment option 3=Treebuilder. The selected record format can only appear as a single child of the current node. Any subsequent child record formats will cause a new instance of the parents in the output XML file for the subsequent children.

 

 

14=Display parent child relationship

This option displays the parent-child relationships in the XML definition, that have been setup via option 12=Record formats followed by option 14=Children.

 

Here is an example:

 

 

          Display parent child relationship                            XDC360D 

                                                                               

 Printer file  . . . . :   AM64MRP1                                            

 Library . . . . . . . :   IFORMDEV                                            

                                                                               

 Position to . . . . . .                Record format                          

                                                                               

 Parent      Child     0903 Description                                        

 P64M1HD1    P64M1HD2   X                                                      

 P64M1HD2    P64M1200   X                                                      

 P64M1200    P64M1210   X                                                      

 P64M1200    P64M1240   1                                                      

 P64M1200    P64M1340   X                                                      

 P64M1200    P64M1420   X                                                      

 P64M1210    P64M1220   X                                                      

 P64M1220    P64M1230   X                                                      

 P64M1240    P64M1420   X                                                      

 P64M1340    P64M1420   X                                                      

 P64M1420    P64M1430   X                                                      

                                                                               

                                                                               

                                                                           End 

 F3=Exit   F5=Refresh   F8=Import   F12=Cancel                                 

                                                                               

 

The third column indicates if the child record format is a potential multiple child (X) or a single child (1).

 

 

15=Display keys

With this option for an XML definition you can view which fields, that are selected to be a key (Selected with an X when working with fields on the XML definition).