Using FDMERGE multi-threaded forms merge commands - Support

Using FDMERGE multi-threaded forms merge commands

From Support

Jump to: navigation, search

What is the FDMERGE Command?

The FDMERGE command is a multi-threaded command in the WINSPOOL library that is designed to merge a text based (SCS) spool file natively on the iSeries with a form overlay and either capture or print the results via one of the following options: 1.) Doc can be captured and merged to the IFS as a PDF or PCL file. 2.) Doc can be captured and merged into an output queue on the iSeries as a PDF or PCL file. 3.) Doc can be captured and merged and printed directly on any PC or network printer connected to the PC print server.

The FDMERGE command can be called interactively or can be embedded into a CL or RPG program to merge form documents as the text spool files are generated on the AS/400 or iSeries system.

NOTE: The FDMERGE command is located within the WINSPOOL library and replaces the FDMRGSPLF command in functionality. FDMRGSPLF suffered from the inability to be multi-threaded. FDMERGE talks to an ASP.Net web application so several iSeries jobs can be merging documents at the same time. However we recommend around 4-8 threads maximum per print server PC. Number of threads can be controlled from the iSeries by creating a job queue where FDMERGE commands are submitted to with a maximum number of active jobs.


FDMERGE Parameters (Merge Spool with Form Overlay)

Spooled file - Spool file name


Job name/user/number - Enter the appropriate job information.


Spooled file number - Enter a spool file number to capture.


Form overlay template name - Enter the prefix to be used when locating the FormsDocs overlay template on the forms print server in C:\Program Files\FormDocs\Templates directory. Example: If INVOICE is entered, the print server will look for a template named: INVOICE.FDT and a text layer file of INVOICE.TLR

Note: The default FormDocs template directory can be change in the RJSFormServer ASP.Net application by editing the Web.Config file setting.

Special values:

  • *SPOOL - Substitute spool file (Default),
  • *USERDATA - Substitute user data value,
  • *FORMTYPE - Substitute form type,
  • *JOBNAME - Substitute job name.


Form destination option - This setting determines where the merged output will go during the form overlay process.

  • *IFSFILE - The document will go to the IFS output file specified in the IFS merged output file name parameter. (Default)
  • *PCPRINTER - The document will print on the PC printer connected to the PC forms print server based on the info passed on the Form merge printer driver parameter.
  • *DESTOUTQ - The document will be re-spooled into an iSeries output queue for printing or distribution based on the destination output queue info. The original spool file name, user data, form type and user defined data valued can be retained.


Form merge data output format - This setting determines the data format output when a document is merged.

  • PDF - Document will be converted to PDF when PDF is specified and the Form merge printer driver name is set to *NONE.
  • PCL - Document will be converted to PCL, Postscript or whatever based on the PC printer driver specified and the Form merge printer driver name parameter.

Example: If HP LaserJet 4 is specified, the data output will be created in PCL format.

  • TIF - Not supported yet.
  • FDD - Not supported yet.
  • CSV - Not supported yet.


Form merge printer driver name - Enter a valid printer driver connected to the electronic forms print server locally or via the network. This setting can be used to print directly to a network printer or to format the distributed output file data based on the printer driver. This is a nice way to capture PCL or Postscript data into an output file after a form is merged.

  • Default = *NONE

Example: If HP LaserJet 4 is specified, the data output will be created in PCL format.


IFS merged output file name - IFS output file name used if *IFSFILE is selected for the form destination option.

  • Default = *NONE


PC/LAN merged output file name - PC or LAN UNC file name or path used if *PCFILE is selected for the form destination option.

  • Default = *NONE


Replace IFS or PC output file

  • *NO - (Default)Do not replace existing file.
  • *YES - Replace existing file.


Merge dest output queue - Enter an output queue and library name for the queue where the report will be re-spooled to in PDF or PCL format if *DESTOUTQ is chosen for the form destination option.


Spool file name - Spool file name for new spool

  • Default = *SAME - Keep same value as original spool


User data - User data value for new spool

  • Default = *SAME - Keep same value as original spool


Form type - Form type for new spool

  • Default = *SAME - Keep same value as original spool


User defined data - User defined data value for new spool

  • Default = *SAME - Keep same value as original spool


Hold spool file - Hold spool file when generated

  • *NO - (Default)
  • *YES


Save spool file - Save spool file after printing

  • *SAME - (Default) Keep same value as original spool
  • *NO
  • *YES

Copies - Number of print copies.

  • Default = 1


Delete original spool file - Delete spool file after merging.

  • *NO - (Default)
  • *YES


Display HTTP response log - Display the reponse received from the RJSFormServer ASP.Net application. Used for testing or debugging purposes

  • *NO - (Default)
  • *YES


Remote server URL - Allows the programmer to override the default FDMERGE Server configured in the FDMRGHOST data area. **DEFAULT - (Default)

  • IPADDRESS:PORT

NOTE: The Remote server URL option is typically used to either load-balance between different Servers or to allow on-demand utilization a high availability or secondary server.


Example Command Calls to FDMERGE

Writing merged electronic form document to an IFS File in PDF Format Run the FDMERGE command to Merge an iSeries text report with a form overlay named INVOICE.FDT and place the resulting file in /test.pdf in the IFS

 FDMERGE FILE(INVOICE) JOB(110513/USER/QPADEV0007) SPLNBR(38) MRGOPTION(*IFSFILE) MRGDTAFMT(PDF) MRGIFSFILE('/test.pdf') REPLACE(*YES)
 

Writing merged electronic form document to an output queue in PDF Format Run the FDMERGE command to Merge an iSeries text report with a form overlay named INVOICE.FDT and place the resulting PDF formatted file into the selected output queue. The spool file name, user data, form type and user defined data information are preserved.

 FDMERGE FILE(INVOICE) JOB(110513/USER/QPADEV0007) SPLNBR(38) MRGOPTION(*DESTOUTQ) MRGDTAFMT(PDF) MRGPRTDRV(*NONE) REPLACE(*NO) MRGOUTQ(QGPL/SAMPLES) RMTSVRURL('1.1.1.1')
 

Writing merged electronic form document to an output queue in PCL Laserjet Format Run the FDMERGE command to Merge an iSeries text report with a form overlay named INVOICE.FDT and place the resulting PCL formatted file into the selected output queue. The spool file name, user data, form type and user defined data information are preserved. Note that this example uses a printer driver named: HP LaserJet 4 to tell the print server to convert the data stream to PC based on the HP driver installed on the print server PC.

Note: This process will fail if you don't have the specified printer driver loaded on the selected PC. If you want to format your report in Postscript, PCL or some other variation,simply install the selected printer driver on the print server PC and specify the printer name on the MRGPRTDRV parameter.

 FDMERGE FILE(INVOICE) JOB(110513/USER/QPADEV0007) SPLNBR(38) MRGOPTION(*DESTOUTQ) MRGDTAFMT(PCL) MRGPRTDRV('HP LaserJet 4') REPLACE(*NO) MRGOUTQ(QGPL/SAMPLES) RMTSVRURL('1.1.1.1')
 

Printing merged electronic form document directly via a printer connected to the print server PC Run the FDMERGE command to Merge an iSeries text report with a form overlay named INVOICE.FDT and print the resulting PCL formatted file using the selected PC printer. Note that this example uses a printer driver named: HP LaserJet 4 to tell the print server to convert the data stream to PC based on the HP driver installed on the print server PC and print it right away.

Note: This process will fail if you don't have the specified printer driver loaded on the selected PC. If you want to format your report in Postscript, PCL or some other variation,simply install the selected printer driver on the print server PC and specify the printer name on the MRGPRTDRV parameter.

 FDMERGE FILE(INVOICE) JOB(110513/USER/QPADEV0007) SPLNBR(38) MRGOPTION(*PCPRINTER) MRGDTAFMT(PCL) MRGPRTDRV('HP LaserJet 4') RMTSYS('125.1.1.33') USR(USER) LOGOPT(*NONE)
 
Personal tools