The FDMERGE command is a multi-threaded command in the WINSPOOL library. FDMERGE merges a text based (SCS) spool file with a form overlay natively on the iSeries and then either:
- Sends the document to the IFS as a PDF or PCL file.
- Sends the document to an output queue on the iSeries as a PDF or PCL file.
- Prints the document directly to a PC or network printer.
You can call the FDMERGE command interactively or embed it in a CL or RPG program to merge spool files as they are generated on the iSeries.
Note: The FDMERGE command is in the WINSPOOL library and replaces the FDMRGSPLF command. FDMRGSPLF did not allow multi-threading. FDMERGE uses an ASP.Net web application, so several iSeries jobs can merge documents at the same time. However, RJS Software recommends 4-8 threads maximum per print server PC. To control the number of threads from the iSeries, create a job queue for FDMERGE commands and set the maximum number of active jobs.
Testing FDMERGE from a Browser
To test FDMERGE, use the format of the following sample URL string:
http://1.1.1.1/RJSFormServer/MergeForm.aspx?FormDocsTemplate=invoice&ReportFormDefFile=invoice&ReportFile=C:\RJSTEMP\invoice.txt&PrinterName=&OutputFile=C:\rjstemp\invoice.pdf&OutputToFile=1&ReplaceOutputFile=1
The following parameters are required:
- FormDocsTemplate - the form name.
- ReportFormDefFile - the text layer file name.
- ReportFile - in the format C:\PATH\TEXTFILENAME.EXT.
- PrinterName
- OutputFile - in the format C:\PATH\PDFFILENAME.PDF.
- OutputToFile=1
- ReplaceOutputFile=1
FDMERGE (Merge Spool with Form Overlay) Parameters
- Spooled file - The name of the spool file to capture.
- Job name, User, and Number - The job information.
- Spooled file number - The spool file number.
- Form overlay template name - A prefix to use to locate the FormsDocs overlay template on the forms print server in C:\Program Files\FormDocs\Templates.
For example: If you enter INVOICE, the print server looks for the template INVOICE.FDT and the text layer file INVOICE.TLR.
Note: To change the default FormDocs template directory in the RJSFormServer ASP.Net application, edit the Web.Config file setting.
Use the following to substitute values:
- *SPOOL - The spool file name. (Default)
- *USERDATA - The user data.
- *FORMTYPE - The form type.
- *JOBNAME - The job name.
- Form destination option - Where the merged output goes.
- *IFSFILE - The IFS output file in IFS merged output file name. (Default)
- *PCPRINTER - The PC printer in Form merge printer driver name.
- *DESTOUTQ - The output queue in Merge dest output queue. You can keep the original spool file name, user data, form type, and user defined data.
- Form merge data output format - The format for the merged output document.
- Form merge printer driver name - A valid local or network printer driver connected to the forms print server. Use this setting to print or format the output file as PCL or Postscript, based on the printer driver.
For example: If you choose a HP LaserJet 4, the output document will be in PCL format.
- IFS merged output file name - If the Form destination option is set to *IFSFILE, the IFS output file name to use.
- Replace IFS or PC output file - Whether to replace an existing file.
- Merge dest output queue - If the Form destination option is set to *DESTOUTQ, the output queue and library name to re-spool the PDF or PCL file to.
- Spool file name - The spool file name for the new spool file.
- *SAME - Keep the original spool file name. (Default)
- User data - The user data value for the new spool file.
- *SAME - Keep the same user data as the original spool file. (Default)
- Form type - The form type for the new spool file.
- *SAME - Keep the same form type as the original spool file. (Default)
- User defined data - The user defined data for the new spool file.
- *SAME - Keep the same user defined data as the original spool file. (Default)
- Hold spool file - Whether to hold spool file when it is generated.
- Save spool file - Whether to save the spool file after printing.
- *SAME - Keep the same value as the original spool file. (Default)
- *NO
- *YES
- Copies - The number of copies to print. The default is 1.
- Delete original spool file - Whether to delete the original spool file after merging.
- Display HTTP response log - Whether to display the reponse received from the RJSFormServer ASP.Net application.
- *NO (Default)
- *YES - For testing or debugging.
- Remote server URL - Allow a programmer to override the default FDMERGE server configured in the FDMRGHOST data area. Use this to either load-balance between different servers or to allow on-demand use of a high availability or secondary server.
- *DEFAULT (Default)
- http://IPADDRESS:PORT
Example Command Calls to FDMERGE
- To send the merged document to an IFS file in PDF format, where the form overlay is INVOICE.FDT and the IFS file to write to is /test.pdf:
FDMERGE FILE(INVOICE) JOB(110513/USER/QPADEV0007) SPLNBR(38) MRGOPTION(*IFSFILE) MRGDTAFMT(PDF) MRGIFSFILE('/test.pdf') REPLACE(*YES)
- To send the merged document to an output queue in PDF format, where the form overlay is INVOICE.FDT, the output queue is SAMPLES in library QGPL, and the spool file name, user data, form type, and user defined data 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')
- To send the merged document to an output queue in PCL Laserjet format, where the form overlay is INVOICE.FDT, the output queue is SAMPLES in library QGPL, the spool file name, user data, form type, and user defined data are preserved, and the printer driver to convert to PCL is HP LaserJet 4:
Note: The printer driver must be loaded on the selected PC.
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')
- To print the merged document directly, where the form overlay is INVOICE.FDT and the printer driver to convert to PCL is HP LaserJet 4:
Note: The printer driver must be loaded on the selected PC.
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)
Last Modified On:
No, open a new Support Case