9.10.3 File output connector definition

You specify a file output connector definition (FileOutputConnectorDefinition tag) as a child element of a CB definition for output (OutputCBDefinition tag).

For details about file output processing, see 10.6 File output.

Organization of this subsection
(1) Format
(2) Details of definition
(3) Example
(4) Naming rules for output files

(1) Format

<FileOutputConnectorDefinition>
 <output compositionType="{WRAP_AROUND|ANTI_WRAP_AROUND}"
  maxNumber="maximum-output-files-count"
  maxSize="maximum-output-file-size"/>
 <file path="output-path-name"
  prefix="prefix-name"
  addDate="{ON|OFF}"
  extension="extension"/>
</FileOutputConnectorDefinition>

(2) Details of definition

FileOutputConnectorDefinition tag (all definition information)
Defines all file output connector definition information. You specify this definition only once.
output tag (output definition)
Defines information about the output processing on output files. You specify this definition only once.
compositionType="{WRAP_AROUND|ANTI_WRAP_AROUND}"
Specifies the structure of the output files. Available structures are wraparound and non-wraparound. With both structures, if a specified output file name already exists, the existing file will be overwritten. If this attribute is omitted, WRAP_AROUND is assumed.
The permitted values are as follows:
  • WRAP_AROUND
    Outputs the files in the wraparound mode.
    In this mode, records are output until the number of files specified in the maxNumber attribute is reached and then the first output file created is overwritten. During normal operation, specify WRAP_AROUND in order to avoid erroneous system operation due to a shortage of disk space.
    If you specify WRAP_AROUND, you must also specify OFF in the addDate attribute in the file tag.
  • ANTI_WRAP_AROUND
    Outputs the files in the non-wraparound mode.
    In this mode, records are output until the number of files specified in the maxNumber attribute is reached and then the standard adaptor stops outputting records.
maxNumber="maximum-output-files-count"
Specifies the maximum number of output files, as an integer from 1 to 100000. If this attribute is omitted, 256 is assumed.
maxSize="maximum-output-file-size"
Specifies the number of record rows to be written in one file, as an integer from 1 to 10000. This attribute cannot be omitted.
file tag (output file definition)
Defines information about the output files. You specify this definition only once.
The output files are created according to this definition. For the naming rules for output files, see (4) Naming rules for output files.
path="output-path-name"
Specifies the path name of the directory to which the files are to be output, as 1 to 160 single-byte characters. If the specified directory does not exist, it will be created. This attribute cannot be omitted.
The following characters are permitted for this attribute:
Single-byte alphanumeric characters, !, #, $, %, &, ', (, ), =, ~, `, {, }, +, -, ^, ., _, @, \, /, :, single-byte space
prefix="prefix-name"
Specifies a prefix for the file names, as 1 to 60 single-byte characters. This must be a path relative to the output path name specified in the path attribute. This attribute cannot be omitted.
The characters \, /, and : cannot be specified.
The following characters are permitted for this attribute:
Single-byte alphanumeric characters, !, #, $, %, &, ', (, ), =, ~, `, {, }, +, -, ^, ., _, @, single-byte space
A specified file name cannot be a reserved device name (such as NUL). If a reserved device name is specified, operation is not guaranteed. If an attempt is made to open a file for which a reserved device name has been specified, the KFSP46211-E message will be displayed, resulting in an error.
addDate="{ON|OFF}"
Specifies whether the date and time (in the format hhmmss_MMDD_YYYY) are to be added to the output file names. If this attribute is omitted, OFF is assumed.
The permitted values are as follows:
  • ON
    Adds the date and time.
  • OFF
    Does not add the date or time.
extension="extension"
Specifies the extension to be added to the output file names. If this attribute is omitted, files without an extension are output.
The following characters are permitted for this attribute:
Single-byte alphanumeric characters, !, #, $, %, &, ', (, ), =, ~, `, {, }, +, -, ^, ., _, @, single-byte space

(3) Example

<?xml version="1.0" encoding="UTF-8"?>
<root:AdaptorCompositionDefinition
xmlns:focon="http://www.hitachi.co.jp/soft/xml/sdp/adaptor/definition/callback/FileOutputConnectorDefinition">
<!-- Omitted -->

<!-- CB definition for output -->
<cb:OutputCBDefinition class="jp.co.Hitachi.soft.sdp.adaptor.callback.io.FileOutputCBImpl" name="outputer1">
 <!-- File output connector definition -->
 <focon:FileOutputConnectorDefinition>
   <!-- Output definition -->
   <focon:output compositionType="WRAP_AROUND" maxNumber="100" maxSize="10"/>
   <!-- Output file definition -->
   <focon:file path="D:\home\" prefix="out" addDate="OFF" extension="csv"/>
 </focon:FileOutputConnectorDefinition>]
</cb:OutputCBDefinition>

(4) Naming rules for output files

Output files are created according to the definition specified in the file tag.

The following shows the format of the names of output files:

'['prefix']' <' ['date-and-time_']' >'['sequence-number']'<.extension>

Legend:
[ ]: An item enclosed in square brackets must be specified as is, including the brackets.
< >: An item enclosed in these symbols is optional.

The following explains each value of the file name.
prefix
The value specified in the prefix attribute is used.
date-and-time
The date and time are specified in the format hhmmss_MMDD_YYYY:
  • hh: Hour (00 to 23)
  • mm: Minute (00 to 59)
  • ss: Second (00 to 59)
  • MM: Month (01 to 12)
  • DD: Day (01 to 31)
  • YYYY: Year (4-digit calendar year)
To specify whether or not the date and time are to be added to the output file name, use the addDate attribute. If you specify ON in the addDate attribute, the date and time are added; if you specify OFF, the date and time are not added.
sequence-number
This is the order in which output files are created. The sequence numbers begin with 1 and end with the value specified in the maxNumber attribute of the output tag. The sequence numbering also resets to 1 when the standard adaptors are restarted.
When the date and time are output to the output file names, the sequence numbering continues even though the year-month-day changes. The following shows an example.
Example:
  • path attribute value: D:\home\
  • prefix attribute value: a
  • addDate attribute value: ON
  • extension attribute value: csv
The table below shows the file creation numbers and the created file names in this example.
Creation numberCreated file name
1D:\home\a235015_0706_2009_1.csv
2D:\home\a235959_0706_2009_2.csv
3D:\home\a000130_0707_2009_3.csv
Note that if WRAP_AROUND is specified in the compositionType attribute in the output tag and ON is specified in the addDate attribute, the files are different even if they have the same sequence numbers because the date and time are added.
extension
The value specified in the extension attribute is used.