You are here: Job and Form Set Rules Reference > JDT Rules Reference > SetOutputFromExtrFile

SetOutputFromExtrFile

Use this form set level rule to extract a print batch name from an extract file for each transaction. This capability is typically used with the MultiFilePrint callback function so you can get a print batch name from the extract file for one or more recipients per transaction.

Syntax

;SetOutputFromExtrFile;;RecordMask PrintBatchName;

Parameter

Description

RecordMask

This tells the system to locate a specific record line.

PrintBatchName

This tells the system to get the print batch name that begins in a specific location and save it to a global variable.

You must include the BatchingByRecipINI or the IfRecipUsed rule before this rule in the AFGJOB.JDT file. If you include the BatchingByRecipINI rule, also include these options:

< BatchingByRecip >

Batch_Recip_Name = 39,FILENAME001;"Batch1";INVESTOR

Batch_Recip_Name = 39,FILENAME002;"Batch2";COMPANY

Batch_Recip_Name = 39,FILENAME003;"Batch3";AGENT

Make sure that FILENAME001,FILENAME002 and FILENAME003 exist at offset=39 in the records. You can see that the mask FILENAME001 is composed of FILENAME and Recipient code 001. So make sure INI control group is set.

To use multiple recipients, each transaction records should contain print multiple print batch names. Here is an example:

FUND/INVESTOR/TEMPLATE/TEMPLATE_LEVEL/INVESTOR_ID\JPMP0355 98PL X

FUND/INVESTOR/TEMPLATE/TEMPLATE_LEVEL/FILENAME001\JPMP0355\JPMP035598PRP031501.pdf

FUND/INVESTOR/TEMPLATE/TEMPLATE_LEVEL/FILENAME002\JPMP0356\JPMP035598PRP031502.pdf

FUND/INVESTOR/TEMPLATE/TEMPLATE_LEVEL/FILENAME003\JPMP0357\JPMP035598PRP031503.pdf

The record mask should match the parameters for the SetOutputFromExtrFile rule and the INI options. The setup for this rule varies, depending on the mode you are running in.

3-step (GenTran, GenData, and GenPrint)

When processing using the GenTran, GenData, and GenPrint programs, you must set the INI options for the GenPrint program as shown here:

< Print >

RCBDFDField = PDFNAME

CallBackFunc = MultiFilePrint

MultiFileLog = ..\data\MFP.LOG

You can use the CUSMultiFilePrint function instead of the MultiFilePrint function, if you want to control the file name.

The CUSMultiFilePrint function is a print callback function that creates a new output file for each recipient and creates a log record of each. This is similar to the MultiFilePrint callback function in GenPrint except it gives you more control over the name of the file and supports long file names.

The system assumes you will use a built-in INI function to create a unique file name each time. This is important because the callback function cannot assign the first file name. You can use a DAL function to assign the first file name. Here is an example of the INI options:

< Printer1 >

Port = ~DALRUN Batch1Files.dal

< Print >

CallbackFunc = CUSMultiFilePrint

Here is an example of a DAL script:

#counter = #counter

file_name = "cusmultifileprint" & #counter & ".pdf"

#counter = #counter+1

return (file_name)

Please note that this function is used for multi-step processing only.

2-step (Single-step processing without the PrinfFormset rule and with GenPrint)

When you use single-step processing but omit the PrintFormset rule and instead use the GenPrint program, you must include the Print control group options:

< Print >

RCBDFDField = PDFNAME

CallBackFunc = MultiFilePrint

MultiFileLog = ..\data\MFP.LOG

Here is an example of the AFGJOB.JDT file you would use:

;NoGenTrnTransactionProc;2;required to combine GenTran/GenData;

;WriteRCBFiles;2;;

;ResetOvFlw;2;;

;BuildFormList;2;;

;LoadRcpTbl;2;;

;RunSetRcpTbl;2;;

;BatchingByRecipINI;2;;;

;SetOutputFromExtrFile;2;35,FILENAME 47,128,PDFNAME;

;WriteOutput;2;;

;WriteNaFile;2;;

;ProcessQueue;2;PostPaginationQueue;

;PaginateAndPropagate;2;;

Be sure to include the WriteOutput, WriteNAFile, and WriteRCBFiles rules.

Single-step (GenData only)

When you use single-step processing, the system does not use a callback function. Instead, it uses the MultiFilePrint INI option in the PrintFormset control group.

In single-step mode, you must have these INI options:

< PrintFormset >

RCBDFDField = PDFNAME

MultiFilePrint = Yes

LogFileType = Text (or XML)

LogFile = mfp.log

     
Note The MultiFilePrint option should only be used with the PDF, RTF, HTML, and XML print drivers.

Here is an example of the AFGJOB.JDT file you would use:

;NoGenTrnTransactionProc;2;required to combine GenTran/GenData;

;ResetOvFlw;2;;

;BuildFormList;2;;

;LoadRcpTbl;2;;

;RunSetRcpTbl;2;;

;SetOutputFromExtrFile;2;35,FILENAME 47,128,PDFNAME;

;WriteOutput;2;;

;WriteNaFile;2;;

;BatchingByRecipINI;2;;

;PrintFormset

Example

;SetOutputFromExtrFile;2;39,FILENAME 51,128,PDFNAME;

In this example, 39,FILENAME is a record mask which tells the system to locate the record line that includes string FILENAME at offset 39. The text, 51,128,PDFNAME tells the system to get the print batch file name at offset 51 in maximum length of 128 and save it to a global variable named PDFNAME. Note that PDFNAME must be defined in the RCBDFDFL.DFD file as a field.

See also