The AS400 commands

The AS400 commands

The AS400 commands :

It is possible to run a CL command from your CL-programs on the IBM i (AS400) platform. If you want to do that, then you should check out this section for the prerequisites.

 

InterFormNG2 is shipped with two predefined commands, that are both quite generic as you can freely define exactly what the commands do in the referenced workflows.

 

The two commands are:

 

1.IFORMNG2/NG2CMD. This command is the most generic and you can in principle use this for any functionality, that you want.

2.IFORMNG2/NG2CPDFEML. This command is prepared for generating an email with an attached PDF.

 

Both commands do nothing unless you create a workflow to match them and the parameters, that you have setup.

 

The most important thing is, that you refer to the path of the workflow in the first parameter of the commands: NG2 endpoint (COMMAND field).

 

The parameters of the commands are mapped into workflow variables.


The NG2CMD command : 

This section covers the IFORMNG2/NG2CMD command on the IBM i platform. In order to run this command or the IFORMNG2/NG2CPDFEML command you first need to ensure, that the prerequisites are met.

 

The NG2CMD command is the most generic command, where the command NG2CPDFEML has been prepared to generate an email with an attached PDF file.

 

The command runs its function via a referenced workflow, that you select via the NG2 endpoint (COMMAND) field. The NG2 Endpoint value must the the path of a

workflow that is specified for AS400 Command input.

 

The NG2CMD command looks like the screens below.

 

The parameters are explained here.

 

 

                     Merge spooled file and overlay (NG2CMD)                    

                                                                                

 Type choices, press Enter.                                                     

                                                                                

 NG2 Endpoint . . . . . . . . . . COMMAND                                       

                                                                                

 Spooled file . . . . . . . . . . FILE           *NONE          Name, *NONE                

 Job name . . . . . . . . . . . . JOB            *              Name, *                  

   User . . . . . . . . . . . . .                               Name                

   Job number . . . . . . . . . .                               000000-999999                 

 Spooled file number  . . . . . . SPLNBR         *ONLY          Number, *ONLY, *LAST                

 Job system name  . . . . . . . . JOBSYSNAME     *CURRENT       Name, *CURRENT                

 Spooled file created:            CRTDATE                                       

   Creation date  . . . . . . . .                *ONLY          Date, *ONLY                

   Creation time  . . . . . . . .                               Time, *ONLY                 

 Code page  . . . . . . . . . . . CODPAG         *INPUT         Number, *INPUT                

 To stream file . . . . . . . . . TOSTMF                                        

                                                                                

 F1 . . . . . . . . . . . . . . . FILE1                                         

                                                                                

                                                                        More... 

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

 F24=More keys                                                                  

                                                                                                                                                                                                             

 

 

 

                     Merge spooled file and overlay (NG2CMD)                    

                                                                                

 Type choices, press Enter.                                                     

                                                                                

 F2 . . . . . . . . . . . . . . . FILE2                                         

                                                                                

 F3 . . . . . . . . . . . . . . . FILE3                                         

                                                                                

 F4 . . . . . . . . . . . . . . . FILE4                                         

                                                                                

 F5 . . . . . . . . . . . . . . . FILE5                                         

                                                                                

 F6 . . . . . . . . . . . . . . . FILE6                                         

                                                                                

 F7 . . . . . . . . . . . . . . . FILE7                                         

                                                                                

 F8 . . . . . . . . . . . . . . . FILE8                                         

                                                                                

 F9 . . . . . . . . . . . . . . . FILE9                                         

                                                                                

                                                                        More... 

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

 F24=More keys                                                                                                                              

 

 

 

 

                     Merge spooled file and overlay (NG2CMD)                    

                                                                                

 Type choices, press Enter.                                                     

                                                                                

 F10  . . . . . . . . . . . . . . FILE10                                        

                                                                                

 P1 . . . . . . . . . . . . . . . PARM1                                         

                                                                                

                                                                                

 P2 . . . . . . . . . . . . . . . PARM2                                         

                                                                                

                                                                                

 P3 . . . . . . . . . . . . . . . PARM3                                         

                                                                                

                                                                                

 P4 . . . . . . . . . . . . . . . PARM4                                         

                                                                                

                                                                                

                                                                                

                                                                                

                                                                        More... 

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

 F24=More keys                                                                  

                                                                                 

 

 

... PARM5 to PARM29 are not displayed here.

 

 

                     Merge spooled file and overlay (NG2CMD)                    

                                                                                

 Type choices, press Enter.                                                     

                                                                                

 P30  . . . . . . . . . . . . . . PARM30                                        

                                                                                

                                                                                

 Attachment name  . . . . . . . . ATTACHNAME                                    

                                                                                

                                                                                

 Print copies . . . . . . . . . . COPIES                                        

 Email server . . . . . . . . . . MAILSERVER                                    

                                                                                

                                                                                

 Email subject  . . . . . . . . . SUBJECT                                       

                                                                                

                                                                                

                                                                                

                                                                                

                                                                                

                                                                        More... 

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

 F24=More keys                                                                  

 

 

 

 

                     Merge spooled file and overlay (NG2CMD)                    

                                                                                

 Type choices, press Enter.                                                     

                                                                                

 Email from . . . . . . . . . . . MAILFROM                                      

                                                                                

                                                                                

                                                                                

 Email to . . . . . . . . . . . . MAILTO                                        

                                                                                

                                                                                

                                                                                

 Email CC . . . . . . . . . . . . MAILCC                                        

                                                                                

                                                                                

                                                                                

 Email BCC  . . . . . . . . . . . MAILBCC                                       

                                                                                

                                                                                

                                                                                

                                                                        More... 

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

 F24=More keys                                                                  

 

 

 

 

                     Merge spooled file and overlay (NG2CMD)                    

                                                                                

 Type choices, press Enter.                                                     

                                                                                

 Email template . . . . . . . . . MAILTEMPL                                     

                                                                                

                                                                                

 Printer name . . . . . . . . . . PRINTER                                       

                                                                                

                                                                                

 File name  . . . . . . . . . . . FILE                                          

                                                                                

                                                                                

                                                                                

 Directory  . . . . . . . . . . . DIR                                           

                                                                                

                                                                                

 Template . . . . . . . . . . . . TEMPLATE                                      

                                                                                

                                                                                

                                                                        More... 

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

 F24=More keys                                                                  

 

 

 

 

                     Merge spooled file and overlay (NG2CMD)                    

                                                                                

 Type choices, press Enter.                                                     

                                                                                

 Input file . . . . . . . . . . . INFILE                                        

                                                                                

                                                                                

                                                                                

 File conflict resolution . . . . CONFLICT                                      

                                                                                

 Log info key . . . . . . . . . . LOGINFO                                       

                                                                                

                                                                                

 Configuration file . . . . . . . CFGFILE                                       

                                                                                 

                                                                                                                                                               

                                                                                

                                                                                

                                                                                

                                                                                

                                                                                

                                                                                

                                                                         Bottom 

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

 F24=More keys                                                                  

                                                                                

 

 

Examples

A few examples of how you can use the command is included in the sections below:

 

1.Command call: Dump the variables. This can be used, if you want to debug a command call.

2.Command call: Email. Shows how you can merge a spooled file into a PDF and email as an attachment via a command call.

3.Command call: Email with extra attachment. How you can add an extra attachment and set the extra attachment name.

4.Command call: Create PDF from payload. Create a PDF in the payload and save it to the IFS in the called command.

5.Command call: Create PDF in workflow. Create a PDF in the workflow from a command.

6.Command call: Merge XML into PDF. Merge an input XML file with a template and save the result as a PDF file.

7.Command call: Print. Merge a spooled file with a template and print it via a command on an IBM i.

 

 

Troubleshoot the NG2CMD command

Here are some potential issues with a description of how they can be solved:

1.TOOLSSERVER must be running in subsystem IFORMNG2 (C R)

2.

3.

 

 

 

TOOLSSERVER must be running in subsystem IFORMNG2 (C R)

If you see this error message, when you call the command, IFORMNG2/NG2CMD, then you should ensure, that the TOOLSHED2 jobs are running in the IFORMNG2 subsystem. You can e.g. see that via the command WRKACTJOB SBS(IFORMNG2) or via IFORMNG2/IFORMNG2 followed by option:12. Work with IFORMNG2 subsystem.

 

Then you should see this:

 

 

                             Work with Active Jobs                     PMK250  

                                                        27/06/24  10:09:49 CEST

 CPU %:    67.4     Elapsed time:   00:11:07     Active jobs:   313            

                                                                              

 Type options, press Enter.                                                    

   2=Change   3=Hold   4=End   5=Work with   6=Release   7=Display message     

   8=Work with spooled files   13=Disconnect ...                               

                     Current                                                   

 Opt  Subsystem/Job  User        Type  CPU %  Function        Status           

      IFORMNG2       QSYS        SBS      .0                   DEQW            

        IFORMNG2     IFORMNG2    BCH      .0  PGM-NGQ500C      DEQW            

        NG2CLEAN     IFORMNG2    BCH      .0  DLY-60           DLYW            

        NG2SERVER    IFORMNG2    ASJ      .0  PGM-STRSVRC      TIMA            

        QP0ZSPWP     IFORMNG2    BCI      .0  PGM-QZSHCHLD     EVTW            

        QP0ZSPWP     IFORMNG2    BCI    62.5  JVM-Properties   THDW            

        QZSHSH       IFORMNG2    BCI      .0  PGM-QZSHSH       EVTW            

        TOOLSHED2    IFORMNG2    BCH      .0  PGM-STRTOOLSS    TIMW            

        TOOLSHED2    IFORMNG2    BCI     1.2  JVM-com.interf   SELW            

                                                                        More...

 Parameters or command                                                         

 ===>                                                                          

 F3=Exit   F5=Refresh       F7=Find      F10=Restart statistics                

 F11=Display elapsed data   F12=Cancel   F23=More options   F24=More keys      

 

 

Please notice the TOOLSHED2 jobs. They need to be active and not stopped with the status MSGW.

 

If they are not running, then you need to ensure that they should run at the next restart of the IFORMNG2/IFORMNG2 subsystem. You need to verify the settings on the IFORMNG2/IFORMNG2 command/menu. You will see these options:

 

 

 IFORMNG2                InterForm NG2 Main Menu                             

                                                                             

 Select one of the following:                         System . . . :  PMK250 

                                                      User . . . . :  KSE    

    Administration                                    Version  . . :  3.4.1  

      1. Work with monitored output queues                                   

      2. Work with XML definitions                                           

                                                                             

     10. Start IFORMNG2 subsystem                                            

     11. End IFORMNG2 subsystem                                              

     12. Work with IFORMNG2 subsystem                                        

                                                                             

     16. Save spooled file to stream file                                    

     31. Display print service log                                           

     51. Adjust CPI - *AFPDS configuration                                   

     91. License                                                             

     92. NG2 installation and configuration                                  

                                                                             

 Selection or command                                                        

 ===>                                                                        

                                                                             

 F3=Exit   F4=Prompt   F9=Retrieve   F12=Cancel                              

 F13=Information Assistant  F16=System main menu                             

 

 

Now select option 92. NG2 installation and configuration and then you should seem something like below:                                                            

                                                                               

 

                      Configure IFORMNG2 Startup (NG2SETUP)                     

                                                                                

 Type choices, press Enter.                                                     

                                                                                

 IBM I Queue Monitor  . . . . . . > *ACTIVE       *ACTIVE, *INACTIVE, *SAME     

 NG2-Server (Output generator)  . > *ACTIVE       *ACTIVE, *INACTIVE, *SAME     

 CommandLine to NG2 . . . . . . . > *ACTIVE       *ACTIVE, *INACTIVE, *SAME     

 QIBM_QSH_CMD_OUTPUT - *JOB . . . > NONE                                        

                                                                                

                                                                                

 JAVA_HOME Blank=System default   > '/QOpenSys/QIBM/ProdData/JavaVM/jdk80/64bit'

                                                                                

                                                                                

                                                                                

 JVM_MEMORY . . . . . . . . . . . > '-Xms2g -Xmn1g -Xmx3g'                      

 Use jt400Native.jar  . . . . . . > '-Dloader.path=/QIBM/ProdData/OS400/jt400/li

 b/jt400Native.jar'                                                             

                                                                                

                                                                                

                                                                                

                                                                        More... 

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

 F24=More keys                                                                  

                                                                               

 

The important setting is, that the option CommandLine to NG2 is *ACTIVE. If it is not, then you need to change the value to *ACTIVE and then restart the IFORMNG2/IFORMNG2 subsystem e.g. via option 11 and 10 on the menu above.

 

Command call: Dump the variables :

This section shows a way to dump the variables, that are set via a command call on the IBM i platform.

 

In this case this workflow has been setup:

 

NG2AS400CMD0001

 

NG2AS400CMD0002

 

As you can see the workflow only has one component, Debug headers apart from the input component.

 

The debug header component simply dumps all workflow variables to the system log.

 

In order to trigger the workflow above you can use a CL program like the one below:

 

 

PGM                                                                    

            DSPJOBLOG  OUTPUT(*PRINT)                                

            IFORMNG2/NG2CMD COMMAND(DUMP) FILE(QPJOBLOG) +            

                         SPLNBR(*LAST) TOSTMF('/iformng2/tofile') +  

                         FILE1('/apf3812home/view/kse.pdf') +        

                         FILE2('F2') FILE3(F3) FILE4(F4) FILE5(F5) +  

                         FILE6(F6) FILE7(F7) FILE8(F8) FILE9(F9) +    

                         FILE10(F10) PARM1('P01') PARM2('P02') +      

                         PARM3('P03') PARM4('P04') PARM5('P05') +    

                         PARM6('P06') PARM7('P07') PARM8('P08') +    

                         PARM9('P09') PARM10('P10') PARM11('P11') +  

                         PARM12('P12') PARM13('P13') PARM14('P14') +  

                         PARM15('P15') PARM16('P16') PARM17('P17') +  

                         PARM18('P18') PARM19('P19') PARM20('P20') +  

                         PARM21('P21') PARM22('P22') PARM23('P23') +  

                         PARM24('P24') PARM25('P25') PARM26('P26') +  

                         PARM27('P27') PARM28('P28') PARM29('P29') +  

                         PARM30('P30') ATTACHNAME(ATTACHMENTNAME) +  

                         COPIES(127) MAILSERVER(GMAIL) +              

                         SUBJECT('test subject') +                  

                         MAILFROM(EMAILFROM) MAILTO(EMAILTO) +      

                         MAILCC(EMAILCC) MAILBCC(EMAILBCC) +        

                         MAILTEMPL(EMAILTEMPLATE) PRINTER(PRINTER) +

                         OUTFILE(FILENAME) DIR(DIRECTORY) +          

                         TEMPLATE(TEMPLATE.IFT) INFILE(INPUTFILE) +  

                         CONFLICT(CONFLICT) LOGINFO(LOGINFOKEY)      

ENDPGM                                                                

 

The program creates a joblog spooled file and calls the DUMP workflow as shown above.

 

After you have run this command, you can now see each of the variables and the values in the system log.

 

You can also see the mapping between the paramters of the NG2CMD command the workflow variables in this section.

Command call: Email :

This section shows a way to Email via a command call on the IBM i platform.

 

In this case this workflow has been setup:

 

NG2AS400CMD0003

 

NG2AS400CMD0004

 

Overview:

 

NG2AS400CMD0005

 

The workflow above can be called with this CL program:

 

PGM                                                              

            DSPJOBLOG  OUTPUT(*PRINT)                            

            IFORMNG2/NG2CMD COMMAND(EMAIL) FILE(QPJOBLOG) +      

                         SPLNBR(*LAST) ATTACHNAME(JOBLOG.PDF) +  

                         MAILSERVER(GMAIL) SUBJECT('This is my +

                         email') +                              

                         MAILFROM('customremail@gmail.com') +    

                         MAILTO('customremail@gmail.com')        

ENDPGM                                                            

 

Some of the email settings in the workflow are fixed and some are variable and specified on the command. You can setup your own rules. In this example an input spooled file is merged with the fixed template, generic.ift and is sent with a variable subject and variable attachment name to and from email addresses, that are specified on the command.

Command call: Email with extra attachment :

This section shows a way to Email with an extra attachment via a command call on the IBM i platform.

 

The extra attachment can be defined via the FILE1-FILE10 parameters on the NG2CMD command. These attachments are as default named file_1 to file_10, but can be renamed with the rename attachment component as shown below.

 

In this case this workflow has been setup:

 

NG2AS400CMD0003

 

NG2AS400Email_0005

 

NG2AS400CMD0004

 

Overview:

 

NG2AS400Email_0006

 

The workflow above can be called with this CL program:

 

PGM                                                                

            DSPJOBLOG  OUTPUT(*PRINT)                              

            IFORMNG2/NG2CMD COMMAND(EMAIL) FILE(QPJOBLOG) +        

                         SPLNBR(*LAST) +                          

                         FILE1('/apf3812home/view/kse.pdf') +      

                         ATTACHNAME(JOBLOG.PDF) MAILSERVER(GMAIL) +

                         SUBJECT('This is my email') +            

                         MAILFROM('customremail@gmail.com') +      

                         MAILTO('customremail@gmail.com')          

ENDPGM                                                                                                                        

 

Some of the email settings in the workflow are fixed and some are variable and specified on the command. You can setup your own rules. In this example an input spooled file is merged with the fixed template, generic.ift and is sent with a variable subject and variable attachment name to and from email addresses, that are specified on the command.


Command call: Create PDF from payload:

This section shows a way to create a PDF file from the payload of a workflow via a command call on the IBM i platform.

 

In this case this workflow has been setup:

 

NG2AS400CMD0006

 

NG2AS400CMD0007

 

Overview:

NG2AS400CMD0008

 

The workflow above expects an input spooled file and it will merge the input spooled file with the variable template, that is specified on the command. The resulting PDF data stream will be stored in the payload of the workflow and returned to the calling command.

 

The workflow above can be called by this CL program:

 

PGM                                                        

            DSPJOBLOG  OUTPUT(*PRINT)                    

            IFORMNG2/NG2CMD COMMAND(PDF) FILE(QPJOBLOG) +

                         SPLNBR(*LAST) +                  

                         TOSTMF('/iformng2/result.pdf') +

                         TEMPLATE('generic.ift')          

ENDPGM                                                    

 

This program generates a joblog as a spooled file and calls the NG2CMD command in order to merge it with the template, generic.ift. The resulting PDF file is stored in the path, /iformng2/result.pdf.

Command call: Create PDF in workflow :

This section shows a way to create a PDF file in a workflow via a command call on the IBM i platform.

 

This workflow has been setup:

 

NG2AS400CMD0009

 

NG2AS400CMD0010

 

Overview:

 

NG2AS400CMD0011

 

The workflow above can be called by a CL program that looks like below:

 

PGM                                                                  

            DSPJOBLOG  OUTPUT(*PRINT)                                

            IFORMNG2/NG2CMD COMMAND(PDF2) FILE(QPJOBLOG) +          

                         SPLNBR(*LAST) OUTFILE(WORKFLOW.PDF) +      

                         DIR('/IFORMNG2') TEMPLATE('generic.ift') +  

                         CONFLICT('Overwrite')                      

ENDPGM                                                                

 

In the program the joblog of the current job is converted into a spooled file and this is merged into a PDF file. All is setup on the command, so that it will create the PDF file: /IFORMNG2/WORKFLOW.PDF based on a merge with the template, generic.ift. If there already is a file with this name in the output directory, then the original file will be overwritten.

Command call: Merge XML into PDF:

The example below shows how you can build an NG2CMD command, that selects an input XML file, a template to merge with and the path and file name of an output PDF file.

 

The relationship between the parameters of the command and the workflow variables are listed in the section, Parameters of the AS400 command.

 

First we need to build the workflow (based on the AS400 command input):

 

The first element of the workflow is the input selection, which is shown below:

 

NG2CommandExampleXML2PDF0001

 

In the image above we have chosen the identification (path) to be PDF_XML. This is the important link between the CL command and the workflow. We set the input type to XML as we expect the command to refer to an XML file.

 

The next element in the workflow loads the selected XML file from the file system (IFS) into the payload of the workflow:

 

NG2CommandExampleXML2PDF0002

 

This is the file to payload workflow component. In this example we refer to the workflow variable, interform.input.file.absolute.path. This variable relates to the parameter, INFILE of the NG2CMD command.

 

The final workflow component creates the PDF file. For that we use the workflow component, Create PDF file. Here we use the component with these parameters:

 

NG2CommandExampleXML2PDF0003

 

In this component we refer to these variables:

 

Template

This is the template (or design), that we want to merge the input XML file with. Here we have chosen that the template (the design) is to be selected on the command, NG2CMD. The variable, com.interform400.xml.Template contains the value of the parameter, TEMPLATE of the NG2CMD command.

 

Output directory

This is the directory in which we want to store the PDF file, that is created by the merge between the input XML file and the referenced template. Here we refer to the variable, $interform.plugin.archiver.folderName, which contains the value of the parameter, DIR in the NG2CMD command.

 

Output filename

This is the name of the PDF file (without the path but including the extension), that we want to create. This is here the variable, interform.plugin.archiver.fileName, which contains the value of the parameter, OUTFILE in the NG2CMD command.

 

Filename conflict resolution

Here we have specified, that the output PDF file is to be overwritten, if it already exists, but this can also be set via an XPath expression.

 

 

With the setup above we can now call this workflow in InterFormNG2 with the command, IFORMNG2/NG2CMD.

 

This is an example where this command is called in a CL program:

 

/* Create the PDF file via the command.                                 */ 

/* The command refers to an input XML file, that is to be merged with a */      

/* template.                                                            */      

PGM                                                                             

             IFORMNG2/NG2CMD COMMAND(PDF_XML) OUTFILE(outfile.pdf) +            

                          DIR('/apf3812home/work') +                            

                          TEMPLATE('Demo_XML.ift') +                            

                          INFILE('/apf3812home/work/Intro_demo.xml')            

ENDPGM                                                                          

 

The command has these parameters:

 

Command

This is the link to the workflow. This must match the path parameter of the AS400 command input component above.

 

Outfile

The name of the PDF file, that we want to create.

 

Dir

The directory in which the PDF file is to be created.

 

Template

The template (design) that the input XML file should be merged with.

 

Infile

The full path of the input XML file, that we want to merge with.


Command call: Print :

This section shows a way to print the merged result between a spooled file and a tempalte in a workflow via a command call on the IBM i platform.

 

This workflow has been setup:

 

NG2AS400CMD0012

 

NG2AS400CMD0013

 

Overview:

 

NG2AS400CMD0014

 

The workflow above can be called via this CL program on the IBM i platform:

 

PGM                                                          

            DSPJOBLOG  OUTPUT(*PRINT)                        

            IFORMNG2/NG2CMD COMMAND(PRINT) FILE(QPJOBLOG) +  

                         SPLNBR(*LAST) PRINTER('PRT08') +    

                         TEMPLATE('generic.ift')            

ENDPGM                                                        

 

The program converts the joblog of the current job into a spooled file and this spooled file is then used as entry for the command, that merge the spooled file with the InterFormNG2 template, generic.ift and prints the result on the InterFormNG2 printer: PRT08. (A prerequisite is, that PRT08 is a registered printer).



The NG2CPDFEML command :

This section covers the IFORMNG2/NG2CPDFEML command on the IBM i platform. In order to run this command or the IFORMNG2/NG2CMD command you first need to ensure, that the prerequisites are met.

 

The NG2CMD command is the most generic command, where this command, NG2CPDFEML is more limited and has been prepared to generate an email with an attached PDF file.

 

The command runs its function via a referenced workflow, that you select via the NG2 endpoint (COMMAND) field. The NG2 Endpoint value must the the path of a

workflow that is specified for AS400 Command input.

 

The NG2CPDFEML command looks like the screens below.

 

The parameters are explained here.

 

 

                   Merge spooled file and overlay (NG2CPDFEML)                  

                                                                                

 Type choices, press Enter.                                                     

                                                                                

 NG2 Endpoint . . . . . . . . . . COMMAND                                       

                                                                                

 Spooled file . . . . . . . . . . FILE           *NONE         Name, *NONE                 

 Job name . . . . . . . . . . . . JOB            *             Name, *                 

   User . . . . . . . . . . . . .                              Name                 

   Job number . . . . . . . . . .                              000000-999999                 

 Spooled file number  . . . . . . SPLNBR         *ONLY         Number, *ONLY, *LAST                 

 Job system name  . . . . . . . . JOBSYSNAME     *CURRENT      Name, *CURRENT               

 Spooled file created:            CRTDATE                                       

   Creation date  . . . . . . . .                *ONLY         Date, *ONLY                 

   Creation time  . . . . . . . .                              Time, *ONLY                 

 Code page  . . . . . . . . . . . CODPAG         *INPUT        Number, *INPUT                 

 To stream file . . . . . . . . . TOSTMF                                        

                                                                                

                                                                                

                                                                                

                                                                        More... 

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

 F24=More keys                                                                  

                                                                               

 

 

                   Merge spooled file and overlay (NG2CPDFEML)                  

                                                                                

 Type choices, press Enter.                                                     

                                                                                

 Attachment name  . . . . . . . . ATTACHNAME                                    

                                                                                

                                                                                

 Email subject  . . . . . . . . . SUBJECT                                       

                                                                                

                                                                                

                                                                                

 Email from . . . . . . . . . . . MAILFROM                                      

                                                                                

                                                                                

                                                                                

 Email to . . . . . . . . . . . . MAILTO                                        

                                                                                

                                                                                

            _

                                                                                

                                                                        More... 

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

 F24=More keys    

 

 

 

                   Merge spooled file and overlay (NG2CPDFEML)                  

                                                                                

 Type choices, press Enter.                                                     

                                                                                

 Email CC . . . . . . . . . . . .                                               

                                                                                

                                                                                

                                                                                

 Email BCC  . . . . . . . . . . .                                               

                                                                                

                                                                                

                                                                                

 Email template . . . . . . . . .                                               

                                                                                

                                                                                

 Template . . . . . . . . . . . .                                               

                                                                                

                                                                                

                                                                                

                                                                                

                                                                        More... 

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

 F24=More keys                            

 

 

 

                   Merge spooled file and overlay (NG2CPDFEML)                  

                                                                                

 Type choices, press Enter.                                                     

                                                                                

 P1 . . . . . . . . . . . . . . . PARM1                                         

                                                                                

                                                                                

 P2 . . . . . . . . . . . . . . . PARM2                                         

                                                                                

                                                                                

 P3 . . . . . . . . . . . . . . . PARM3                                         

                                                                                

                                                                                

 P4 . . . . . . . . . . . . . . . PARM4                                         

                                                                                

                                                                                

 P5 . . . . . . . . . . . . . . . PARM5                                         

                                                                                

                                                                                

                                                                                

                                                                         Bottom 

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

 F24=More keys 

                                                                               



Parameters of the AS400 command :

This section describes all entry parameters of both of the InterFormNG2 commands for the IBM i platform: The NG2CMD and NG2CPDFEML commands.

 

The list below refers to the sequence of the parameters of the command, NG2CMD. The NG2CPDFEML command contains only a subset of these parameters.

Please notice, that all values and parameters are case sensitive in InterFormNG2.

 

 

Identification of the workflow (required)

Parameter on command

NG2 workflow variable

Description

COMMAND (NG2 Endpoint)

N/A

Selects the workflow to execute. Identified as Path on the AS400 command input.

 

 

General parameters (Optional)

Parameter on command

NG2 workflow variable

Description

CFGFILE (Configuration file)

N/A

Selects the InterFormNG2 enviroment, that the command should call.

 

If this is not filled out: The command will search for the file ng2CommandAPI.properties in the IFS directory, /iformng2/user. If the configuration file is not found in this directory, then the file is expected to be found in the IFS directory, /iformng2/InterFormNG-shell/Core.

 

If this is filled out: You can enter a configuration file here, if you want to use a different configuration, than the standard configuration. The file should be placed in the IFS directory, /iformng2/user and you specify only the file name - not the path. Details of this configuration file is found in the section, Setup InterFormNG2 AS400 command API.

LOGINFO (Log info key)

interform.log.infointerform.log.info

An optional unique key for lookup in the list of tenant job logs.

TEMPLATE (Template)

com.interform400.xml.Template

The InterFormNG2 template, that should be merged with the input file (e.g. XML or spooled file)

 

 

Optional identification and attributes of a spooled file

Parameter on command

NG2 workflow variable

Description

FILE (Spooled file)

interform.input.spooled.splf

The name of the input spooled file or *NONE if no spooled file is selected.

JOB (Job name)

interform.input.spooled.jobName

The name of the job, that created the spooled file. * refers to the current job.

JOB (User)

interform.input.spooled.user

The user profile, that created the spooled file. If * is used for the job, then this can be blank.

JOB (Job number)

interform.input.spooled.jobNbr

The job number of the job, that created the spooled file. If * is used for the job, then this can be blank.

SPLNBR (Spooled file number)

interform.input.spooled.splfNbr

The spooled file number. If * is used for the job, then this can be blank.*LAST means use the last spooled file with the specifications above and *ONLY refers to the single spooled file, that match the specification of the job and spooled file name above.

CRTDATE (Creation date)

interform.input.spooled.crtDate

Creation date of the spooled file.

CRTDATE (Creation time)

interform.input.spooled.crtTime

Creation time of the spooled file.

CODPAG (Codepage)

N/A

The codepage to use when extracting data from the input spooled file.

A lot of spooled file attributes are also retrieved, and they can used in the workflow. They are listed here.

 

 

Optional Output file

Parameter on command

NG2 workflow variable

Description

TOSTMF (To stream file)

N/A

Saves the payload, that the workflow returns as this file. Leave it blank, if nothing is returned or if the output e.g. is generated and save directly in the workflow.

 

 

Optional Input parameters

Parameter on command

NG2 workflow variable

Description

PARM1..PARM30  (P1..P30)

parm_1..parm_30

Optional input parameters, that the workflow can use as variables.

 

 

Optional Email parameters

Parameter on command

NG2 workflow variable

Description

ATTACHNAME (Attachment name)

interformng.attachmentName

The name to use for the attachment in the email.

MAILSERVER (Email server)

interformng.emailServerName

The name of the email server in InterFormNG2, that you want to use for the email.

SUBJECT (Email subject)

email.subject

The subject of the outgoing email.

MAILFROM (Email from)

email.from

The email address of the sender of the email.

MAILTO (Email to)

email.to

The email address(es), that the email is to be sent to.

MAILCC (Email CC)

email.cc

The email address(es), that should be CC receivers of the email

MAILBCC (Email BCC)

email.bcc

The email address(es), that should be BCC receivers of the email

MAILTEMPL (Email template)

interformng.emailTemplate

The email template, that configures the contents of the email.

FILE1..FILE10  (F1..F10)

N/A

Optional input files, that will be attached to the email as extra file attachments in the email.

The attachments are named: file_1 to file_10 unless you rename the attachment first with the rename attachment workflow component. You can also use these files for other things e.g. as dynamic images in the templates.

 

 

Optional Print parameters

Parameter on command

NG2 workflow variable

Description

PRINTER (Printer name)

interform.destination.printer.printerName

Reference to a printer, that is registered in InterFormNG2.

COPIES (Print copies)

interform.destination.printer.copies

The number of copies, that should be printed.

 

 

Optional File input/output parameters

Parameter on command

NG2 workflow variable

Description

FILE1..FILE10  (F1..F10)

N/A

Optional input files, that will be attachments in the workflow

The attachments are named: file_1 to file_10 unless you rename the attachment first with the rename attachment workflow component. You can also use these files for other things e.g. as dynamic images in the templates.

INFILE (Input file)

interform.input.file.absolute.path

The full path to an input file, that InterFormNG2 should use. The contents of the file is binary inserted as the contents of the initial payload, when the linked workflow is processed.

OUTFILE (File name)

interform.plugin.archiver.fileName

The name of the output file.

DIR (Directory)

interform.plugin.archiver.folderName

The path (without the file name) to where the output file is to be saved.

CONFLICT (File conflict resolution)

interformng.output.conflictResolution

How to handle it, if the output file already exists. These values are accepted: Overwrite, Rename, AppendVersion, AppendTimestamp This affects only the files written in the workflow as selected above. More information.

TOSTMF (To stream file)

N/A

Saves the payload, that the workflow returns as this file - independently of the workflow. Leave it blank, if nothing is returned or if the output e.g. is generated and save directly in the workflow.


 














    • Related Articles

    • Extra PCL commands

      The Extra PCL commands workflow component is an advanced set meta data workflow component. It only has effect, if you later merge into a PCL print data stream later in the same workflow. With this you can add your own PCL commands in the PCL output ...
    • Extra PJL commands

      With this advanced set meta data workflow component, you can add your own PJL commands in the PCL/PDF output from InterFormNG2 e.g. for enabling/disabling color printing, stapling, punching to select a specific output bin or include user ID and ...
    • Enable AS400 commands in InterFormNG2

      One of the prerequisites for calling functions in InterFormNG2 via commands on the IBM i platform is, that you have enabled AS400 commands in the InterFormNG2 configuration. It is possible to setup InterFormNG2 to run the commands on another machine ...
    • IBM i Command input

      It is possible to call InterFormNG2 functions from an IBM i command, IFORMNG2/NG2CMD. The command then calls an InterFormNG2 workflow, which can generate various output and also return an output file to the command. The command will wait for the ...
    • Setup AS400 command workflows

      The third of the prerequisites for calling functions in InterFormNG2 via commands on the IBM i platform is, that you have setup matching workflows, that are triggered by the AS400 commands, that you call. The workflows that you create must have the ...