Configuring the Adapter : FileSubscriber Examples

FileSubscriber Examples
This section contains several configuration file examples that you can use as models.
Example 11 Configuration File for a Delimited File
This example shows the FileType section of a configuration file for processing TIBCO messages for delimited file.
The FileType section of the configuration file follows:
[FileType]
FILE_OPTIONS = { filePrefix = "FT1", delimiter = "|", skipPadding=”true”,
OutputDataset = ”TIBCO.TEST.OUTPUT”,
saveFileInterval = "5000", subscribeSubjectName="A.B" }
 
FILE_LINE = { field = { description = "Part Number", fromMessage="true", type="STRING", value="PartNo", position=”1”},
 
   field = { description = "Description", fromMessage="true",
type="STRING", value="Desc", position=”2” },
 
   field = { description = "Manufacturer", fromMessage="true",
type="STRING", value="Manuf", position=”3” },
 
   field = { description="Model", fromMessage="true",
type="STRING", value="Model", position=”4” },
 
   field = { description="Qty", fromMessage="true",
type="INTEGER", value="Qty", position=”5” },
 
   field= { description="Price", fromMessage="true",
type="FLOAT", value ="Price", position=”6” }
            }
Assuming that the file that was used in the first FilePublisher example is being subscribed to, the file that FileSubscriber would create would look like the following:
 
115-01-0500|MONITOR|SONY|VIEWSONIC|01|350.50
115-15-6542|CPU-PIII750MHZ|COMPAQ|PRESARIO|01|900.00
115-67-7356|HDD20GB|SEAGATE|ST500|01|276.60
115-34-8767|FDD54|HP|T24333|01|86.00
115-77-5555|CRDW|HP|T75668|01|350.00
115-78-4646|KEYBOARD|COMPAQ|EASYKEY101|01|32.00
115-88-4454|MOUSE|MICROSOFT|M323|01|26.00
115-36-2727|WINDOWS2000|MICROSOFT|MSW2000|01|400.00
Example 12 Configuration File for a Fixed-length File
This example shows the FileType section of a configuration file for processing TIBCO Rendezvous messages to fixed length file.
The FileType section of the configuration file follows:
 
[FileType]
FILE_OPTIONS = { filePrefix = "ft2", datasetType = ”SEQ”,
           skipPadding=”false”, outputDataset=”TIBCO.TEST.OUTPUT”,            subscribeSubjectName = "A.C" }
 
FILE_LINE = {
   field = { description = "Part Number", fromMessage="true",
         length = ”6”,type="STRING", value="PartNo", length = ”11”,
         position=”0”},
 
   field = { description = "Description", fromMessage="true",
         type="STRING", value="Desc", length = ”15”,          position=”11” },
 
   field = { description = "Manufacturer", fromMessage="true",
         type="STRING", value="Manuf", length = ”11”,          position=”26” },
 
   field = { description="Model", fromMessage="true",
         type="STRING", value="Model", length = ”12”,          position=”37” },
 
   field = { description="Qty", fromMessage="true",
         type="INTEGER", value="Qty", length = ”2”,          position=”49” },
 
   field= { description="Price", fromMessage="true",
         type="FLOAT", value ="Price", length = ”6”,          position=”51” }
            }
 
Assuming that the file that was used in the second FilePublisher example is being subscribed to, the file that FileSubscriber creates a file that looks like the following:
 
115-01-0500 MONITOR SONY VIEWSONIC 01 350.50
115-15-6542 CPU-PIII750MHZ COMPAQ PRESARIO 01 900.00
115-67-7356 HDD20GB SEAGATE ST500 01 276.60
115-34-8767 FDD54 HP T24333 01 86.00
115-77-5555 CRDW HP T75668 01 350.00
115-78-4646 KEYBOARD COMPAQ EASYKEY101 01 32.00
115-88-4454 MOUSE MICROSOFT M323 01 26.00
115-36-2727 WINDOWS2000 MICROSOFT MSW2000 01 400.00
Example 13 Accommodating Different Order Header and Order Line Formats
In the FilePublisher example, a file with multiple record types was used as an example. This example shows how to configure the FileSubscriber to handle the TIBCO Rendezvous messages to process a multiple format file. The following steps could be used to set up the configuration file:
1.
2.
Use a FILE_LINE element with a containerName parameter to define the format of each output line to be written after retrieving data from the message. FileSubscriber creates an output record for each FILE_LINE element.
For the example shown, FileSubscriber creates a header record for the “OrderHeader” container, then it creates three detail records from the “OrderDetail” record.
Specify the field attributes for the output record by using the messageItem parameter.
The pertinent parts of the configuration file would look like:
[FileType]
FILE_OPTIONS = { filePrefix = "ft4", subscribeSubjectName = "A.D”,
outputDataset=”TIBCO.TEST.OUTPUT” }
}
FILE_LINE = { constraint = { containerName = "OrderHeader" },
field = { fromMessage = "true", position = "0", description =
"HDR",
length = “3”, type=”STRING" },
 
field = { … }
}
 
FILE_LINE = { constraint = { containerName = “OrderDetail” } ,
field = {fromMessage = "true", position = = "0", description
= "DTL",
length = ”3”, type = “STRING” } ,
 
field = { … },
field = { … },
field = { … }
}
Assuming that the file that was used in the third FilePublisher example is being subscribed to, the file that FileSubscriber would create would look like this:
 
HDR123-234-52344
DTL34234:22343:3534534
DTL47463:34763:2734641
DTL18231:23423:1234123
HDR874-647-12331
DTL81321:46157:412564 …
Example 14 Supporting COBOL Numeric Data Types
In this sample configuration file, there are three fields specified for output. The FileType is specified as isBinary=”true“.
The first field, "F64 to binary", is defined as a INTEGER field that is converted to BINARY format. The field's data is written starting at byte 12. Because the field precision has been specified as "9,0", the output data length will be 8 bytes.
The second field, “F64 to packed", is defined as a DOUBLE field that is converted to PACKED format. The field's data is written starting at byte 1. Because the field precision has been specified as "7,2", the output data length will be 4 bytes.
The third field, "Str to packed", is defined as a STRING field that is converted to ZONED format. The field's data is written starting at byte 50. Because the field precision has been specified as "9,2", the output data length will be 9 bytes.
 
[FileType]
FILE_OPTIONS = { filePrefix = "TESTP", subscribeSubjectName = "PACKED.DATA", appendDateTime = "false", appendToExistingFile = "true", padCharacter = " ", autoGenerateFile = "true",
generateFileSubjectName = "GEN.FILE",
isBinary="true" , lineLength = "2060",saveFileInterval = "3000",
isCertified = "false" }
 
FILE_LINE = {
field = { description = "F64 to binary", fromMessage = "true",
position="12", convertTo="BINARY", value="binary",
precision="9,0", type = "INTEGER" },
field = { description = "F64 to packed", fromMessage = "true",
position="1", convertTo="PACKED", value="packed",
precision="7,2", type = "DOUBLE" } ,
field = { description = "Str to packed", fromMessage = "true",
position="50", convertTo="ZONED", value="packedstring",
precision="9,2", type = "STRING"
}
}
Example 15 Configuration File for VSAM Files
#------------------------------------------------------#
# [Options] sections specifies either of RV or RVCM #
# session parameters, Adapter name, whether to publish #
# heartbeat messages or not, heart beat timer interval.#
# -----------------------------------------------------#
[Options]
RV_SESSION = { name="FileSubscriber_01",
service="", network="",daemon=""
}
OUTPUT_DIRECTORY = "SEQOUT"
ADAPTER_NAME = "FILE_TSTFASUB_01"
PUBLISH_HEARTBEAT = "false"
HEARTBEAT_TIME = "2000"
 
###################################################
# FTVSAM BINARY VSAM file #
###################################################
[FileType]
 
FILE_OPTIONS = {
filePrefix = "FTVSAM",
outputDataset="TIBCO.TFA.KSDSOUT.CLUSTER",
dataSetType="VSAM",
isRBA="false",
vsamUseLog = "StopOnFull",
vsamLogFile="TIBCO.TFA.KSDSOUT.REPLOG",
vsamFileMode="REPLACE",
subscribeSubjectName = "A.FTVSAM.REPLACE",
primaryAlloc="7",
secondaryAlloc="3",
generateFileOnNumberOfMessages="5",
generateFileSubjectName="A.VSAMFILE",
generateFileFieldName="CLOSEFILE"
}
 
FILE_LINE = {
field = { fieldStart="01", value="emp_number",
type="STRING",
length="4",
fromMessage = "true" },
field = { fieldStart="05", value="user_id", type="STRING",
length="8",
fromMessage = "true" },
field = { fieldStart="32", value="pers_info", type="STRING",
length="37",
fromMessage = "true" }
}
Example 16 Configuring a Subscriber Using ECM with ECMSubscriber Handshake (“Strict” ECM)
This configuration is for subscribing a file using ECM with __TIBCO_AE_ADAPTER_FAFT_*.<subject name> administrative messages handshake.
[FileType]
FILE_OPTIONS = {
               filePrefix = "SB027",
               dataSetType = "SEQ",
               subscribeSubjectName = "C.BLOCK_TRANSFER.FILE",
               appendToExistingFile = "true",
               useExplicitConfirmation = "true",
               ECMSubscriberName = "SUB1",
               ECMSubscriberName = "SUB2",
               lineLength = "1024",
               primaryAlloc = "500",
               secondaryAlloc = "500",
               blockTransferMode = "true",
               forcePublishedFileName = "true",
               generateFileSubjectName ="END.BLOCK_TRANSFER.FILE",
               exitOnFileSaveError = "true",
               isBinary = "true",
               generateFileFieldName = "FileName" ??mixedcase??
             }
Example 17 Configuration for EMS
[Trace]
FILE_NAME = "KISHORE.SUB.EMSS001.LOG"
FILE_COUNT = "5"
FILE_LIMIT = "100000"
TRACE_LEVEL = 3
PRINT_STDOUT = "TRUE"
[Options]
EMS_SESSION = { providerURL="tcp://EMSserver_address:Port",
user="", password=""
}
ADAPTER_NAME = "SUB003"
PROGRESS_DATASET = "KISHORE.FT11.PRSPDS"
OUTPUT_DATASET = "KISHORE.FT11.OUTPDS"
ADAPTER_NAME = "SUB003"
PUBLISH_HEARTBEAT = "true"
HEARTBEAT_TIME = "60000"
 EPM_DESTINATION = "A.EMSS001"
ERROR_DESTINATION = "ERROR.SUB003"
[FileType]
FILE_OPTIONS = {
filePrefix = "FT11",
appendDateTime = "true", padCharacter = " ",
delimiter = "|", skipPadding = "false",
lineLength = "80", autoGenerateFile="false",
autoGenerateFile="false",
JMS_TIBCO_MSG_TRACE = "body",
executeBeforeProcess = "KISHORE.TIBFA310.JCL(TFAALOC)",
generateFileDestinationName = "GEN.FILE",
genFilePublishDestinationName = "B.SUB003.FT11.END",
outputDataset = "KISHORE.SUB003.TXT",
fileHeader = "#[%4,NUMBER_OF_RECORDS%] %%This is a file header [%14,DATE_TIME%]",
fileTrailer = "#[%4,NUMBER_OF_RECORDS%] %%This is a file trailer [%14,DATE_TIME%]",
subscribeDestinationName = "A.FT11",
subscribeDestinationType = "TOPIC",
isCertified = "true",
isBinary="false",
generateFileOnNumberOfMessages="06"
}
FILE_LINE = {
field = {
description = "Label1", fromMessage = "true", position="1",
length="10", type = "STRING" , value = "Label1"
            },
field = {
description = "label2", fromMessage = "true", position="11",
length = "10", type = "STRING", value = "Label2"
            },
field = {
description = "label3", fromMessage = "true", position = "21",
length = "10", type = "STRING", value = "Label3"
            },
field = {
description = "label4", fromMessage = "true", position = "31",
length = "10", type = "STRING", value = "Label4"
            },
field = {
description = "label5", fromMessage = "true", position = "41",
length = "2", type = "STRING", value = "Label5"
            },
field = {
description = "label6", fromMessage = "true", position = "43",
length = "10", type = "FLOAT", value = "Label6"
            },
field = {
description = "TimeStamp", fromMessage = "true", position = "53",
length = "24", type = "TIME", value = "TimeStamp"
            }
}
Example 18 Sample Configuration for Multiple File Types in a single Config file
This configuration demonstrates how multiple File Types can be defined in a single config file. Up to a maximum of 512 File Types can be defined in a single config file. A single config file can contain any combination of record mode, block mode, VSAM, SEQ, or GDG files.
[Trace]
FILE_NAME = "DUQAINE.SUB.EMSS001.LOG"
FILE_COUNT = "5"
FILE_LIMIT = "100000"
TRACE_LEVEL = 3
PRINT_STDOUT = "TRUE"
TZ = "PST8PDT"
[Options]
RV_SESSION = { name="FileSubscriber_01",
service="", network="", daemon="" }
ADAPTER_NAME = "SUB001"
PROGRESS_DATASET = "DUQAINE.FT11.PRSPDS"
OUTPUT_DATASET = "DUQAINE.FT11.OUTPDS"
ADAPTER_NAME = "SUB003"
PUBLISH_HEARTBEAT = "true"
HEARTBEAT_TIME = "60000"
EPM_SUBJECT = "A.RVSUB001"
ERROR_SUBJECT = "ERROR.SUB001"
 
[FileType]
FILE_OPTIONS = {
filePrefix = "FTVSAM",
outputDataset="TIBCO.TFA.KSDSOUT.CLUSTER",
dataSetType="VSAM",
isRBA="false",
vsamUseLog = "StopOnFull",
vsamLogFile="TIBCO.TFA.KSDSOUT.REPLOG",
vsamFileMode="REPLACE",
subscribeSubjectName = "A.FTVSAM.REPLACE",
primaryAlloc="7",
secondaryAlloc="3",
generateFileOnNumberOfMessages="5",
generateFileSubjectName="A.VSAMFILE",
generateFileFieldName="CLOSEFILE"
}
FILE_LINE = {
field = { fieldStart="01", value="emp_number",
type="STRING",
length="4",
fromMessage = "true" },
field = { fieldStart="05", value="user_id", type="STRING",
length="8",
fromMessage = "true" },
field = { fieldStart="32", value="pers_info", type="STRING",
length="37",
fromMessage = "true" }
}
[FileType]
FILE_OPTIONS = {
filePrefix = "SB027",
dataSetType = "SEQ",
subscribeSubjectName = "C.BLOCK_TRANSFER.FILE",
appendToExistingFile = "true",
useExplicitConfirmation = "true",
ECMSubscriberName = "SUB1",
ECMSubscriberName = "SUB2",
lineLength = "1024",
primaryAlloc = "500",
secondaryAlloc = "500",
blockTransferMode = "true",
forcePublishedFileName = "true",
generateFileSubjectName ="END.BLOCK_TRANSFER.FILE",
exitOnFileSaveError = "true",
isBinary = "true",
generateFileFieldName = "FileName" ??mixedcase??
}
 
[FileType]
FILE_OPTIONS = { filePrefix = "ft2", datasetType = "GDG",
skipPadding="false", outputDataset="TIBCO.TEST.OUTPUT", subscribeSubjectName = "A.C" }
FILE_LINE = {
field = { description = "Part Number", fromMessage="true",
length = "6",type="STRING", value="PartNo", length = "11",
position="0"},
field = { description = "Description", fromMessage="true",
type="STRING", value="Desc", length = "15", position="11" },
field = { description = "Manufacturer", fromMessage="true",
type="STRING", value="Manuf", length = "11", position="26" },
field = { description="Model", fromMessage="true",
type="STRING", value="Model", length = "12", position="37" },
field = { description="Qty", fromMessage="true",
type="INTEGER", value="Qty", length = "2", position="49" },
field= { description="Price", fromMessage="true",
type="FLOAT", value ="Price", length = "6", position="51" }
}