Introduction : FileSubscriber

FileSubscriber
FileSubscriber listens for TIBCO EMS or Rendezvous messages on predefined subjects and generates output records to a data set. For each file type, FileSubscriber keeps the output in a temporary data set and maintains a progress file. There are two modes of operation listed under Output File Creation:
Figure 6 FileSubscriber Workflow
FileSubscriber supports only SEQ, GDG, PDS, or VSAM data sets for output. Process data sets (progress file and temporary data set) are always SEQ.
Configuring FileSubscriber
You can use the FileSubscriber configuration file to configure the following aspects of the subscriber. See FileSubscriber Configuration File for a list of the sample configuration files and data sets available with the Adapter.
Subscribing to many subjects and writing to many files simultaneously, because it supports multiple subjects and multiple file types
Generating output files automatically, based on receiving an EOF message or on the values of certain configuration parameters. For example, the Subscriber can be configured to create an output file if the number of messages received exceeds a certain number (generateFileOnNumberofMessages), or if the specified time period has elapsed (saveFileInterval).
On error-restart, automatically recovering data and using any temporary files that were in use before the error-restart. Generating final output files using these files
Support for multiple-line records so that a TIBCO EMS/Rendezvous message can generate several lines in an output file, if required
Progress File
Regardless of the method used, FileSubscriber creates a progress file that can be used for viewing the status of file processing. By convention, the subscriber’s progress file is named <outputDataset>.<filePrefix>.PRG.
Output File Creation
Output files can be generated using any one or combination of the following methods:
a.
Auto-generate mode—FileSubscriber generates an output data set from the temporary data set based on a timer defined in the configuration file.
b.
End-Of-File (EOF) message—FileSubscriber generates an output data set from the temporary data set when it receives an end-of-file message.
c.
Generate on number of messages received. FileSubscriber generates an output data set when it has received a preconfigured number of messages.
Options a.) and c.) are mutually exclusive.
When using option a. or c., a new file will be generated when either the counter is reached or the timer goes off. To avoid overlaying the previous file generated, one can use one of these two parameters appendDateTime, appendToExistingFile.
Care must be taken if using option b.) in combination with the other options, as you could potentially lose data if the options are not configured correctly.
If automatic file creation is specified, then FileSubscriber writes an output file automatically depending on the timer interval you specify, or when the configured number of messages have been written.
You can generate an output file based on an end-of-file message. If you exercise this option, an output file is generated whenever FileSubscriber receives an end-of-file message on the generateFileSubjectName.
The format of an output file is shown in Figure 7.
Figure 7 Format of an Output File
Output File Naming
When FileSubscriber writes the output file, it adds the filePrefix parameter as the last qualifier to the output data set to derive the complete name of the output file.
If the dataSetType parameter is set for a GDG or sequential data set, the complete name of the output file is outputDataset.filePrefix.
If the dataSetType parameter is set for a VSAM data set, the output file name is the same as outputDataset. In contrast to the other two file types, there are no additions. This file is allocated prior to subscribing. The subscriber reads the catalog information (record length, key length, key offsets, file organization (KSDS, ESDS, RRDS), sharing info) from the MVS catalog services. The file name is generally the Cluster name. For KSDS VSAM file types, path name can also be specified. This enables subscription based on alternate keys.
You can also optionally append the system date and time to the file name by using the appendDateTime parameter. This option can only be used for sequential data sets.
Block Transfer and Record Transfer Mode
Files can be read or written in block transfer mode or in record mode. Block transfer mode means that the file is read in blocks without regard to its record or field structure. The data are published as blocks and must be subscribed to in block transfer mode as well.
TIBCO Adapter for Files for z/OS supports both fixed-block (FB) and variable-block (VB) files.
In addition, each of the above data transfer modes has a guaranteed and reliable mode, as follows:
Explicit Confirmation Mode (ECM) – guaranteed mode for RV transport
Durable Subscribers – guaranteed delivery for EMS transport