Write Fixed-Length File

Operation Name

Write Fixed-Length File

Function overview

Writes the input data to fixed-length file.

Data model

Data model of this type of component is table model type.

Properties

For information about using variables, refer to "variables".
Basic settings
Item name Required / Optional Use of Variables Description Remarks
Name Required Not available Enter the name on the script canvas.  
Input data Required Not available Select the component on the script canvas.  
Required settings
Item name Required / Optional Use of Variables Description Remarks
File Required Available Enter the file path to write a fixed-length.

Click [Browse] button to activate the file Selectr and Select the file.
Format Required Not available Select a file format definition that is fixed for global resources.
Refer to "Fixed-Length Write Wizard for details about how to configure the format.
  • [Add]:
    Adds new global resource.
  • [Edit]:
    Global resource settings can be edited with "Edit Resource list".
 
Property Action
Item name Description Remarks
Preview Start the previewer, display the contents of the file specified in [File].
  • Disables when specified file dose not exist, or variables are set in [File].
  • Encode specified in [Encoding] is displayed.
  • You can not edit the file contents.
  • Files with file size smaller than 1MB can be displayed in previewer.If the file size exceeds 1MB, 1MB size contents from the beginning of the file are displayed.
Write settings
Item name Required / Optional Use of Variables Description Remarks
Encoding Required Available Select or input write file encode.

Use only the canonical name supported by Java SE Runtime Environment 8 when specifying the encoding directly in the field.
Refer to "Supported Encodings"(http://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html) for details.
  • For information regarding the default values used, refer to "Default encoding".
New line code Required Not available Select a new line code.
  • [AUTO]: (default)
    Implementation-dependent
  • [NONE]:
  • [CR]:
    Primarily Mac OS (Version 9)
  • [LF]:
    Primarily UNIX/Linux
  • [CR + LF]:
    Primarily Microsoft Windows
  • The line code }[Encoding]{/0 to be encoded in the encoding specified by the byte value depends on encoding.
    • LF
      Encoding Byte value
      UTF-8 0x0a
      Shift_JIS 0x0a
      Windows-31J 0x0a
      EUC-JP 0x0a
      ISO-8859-1 0x0a
      ISO-2022-JP 0x0a
      US-ASCII 0x0a
      UTF-16 0xfe,0xff,0x00,0x0a
      UTF-16BE 0x00,0x0a
      UTF-16LE 0x0a,0x00
      Cp930 (EBCDIC) 0x15

    • CR
      Encoding Byte value
      UTF-8 0x0d
      Shift_JIS 0x0d
      Windows-31J 0x0d
      EUC-JP 0x0d
      ISO-8859-1 0x0d
      ISO-2022-JP 0x0d
      US-ASCII 0x0d
      UTF-16 0xfe,0xff,0x00,0x0d
      UTF-16BE 0x00,0x0d
      UTF-16LE 0x0d,0x00
      Cp930 (EBCDIC) 0x0d

    • CRLF
      Encoding Byte value
      UTF-8 0x0d,0x0a
      Shift_JIS 0x0d,0x0a
      Windows-31J 0x0d,0x0a
      EUC-JP 0x0d,0x0a
      ISO-8859-1 0x0d,0x0a
      ISO-2022-JP 0x0d,0x0a
      US-ASCII 0x0d,0x0a
      UTF-16 0xfe,0xff,0x00,0x0d,0x00,0x0a
      UTF-16BE 0x00,0x0d,0x00,0x0a
      UTF-16LE 0x0d,0x00,0x0a,0x00
      Cp930 (EBCDIC) 0x0d,0x15
Overwrite Optional Not available If the specified file exists, Select whether to overwrite it or not.
  • [Checked]: (default)
    Overwrite.
  • [Not Checked]:
    Do not overwrite.Error occurs if file already exists.
 
Append Optional Not available If the specified file exists, Select to overwrite it or append it to the end of the file.
  • [Checked]:
    Append to the end of the file.
  • [Not Checked]: (default)
    Overwrite.
  • Enables only when [Overwrite] is checked.
Transaction
Item name Required / Optional Use of Variables Description Notes
Execute transaction processing Required Not available Select whether to perform transaction processing.
  • [Checked]:
    Perform transaction processing.
  • [Not Checked]: (default)
    Transaction processing is not performed.
Refer to "File Adapter Transaction" for details.
 
Comment
Item name Required / Optional Use of Variables Description Remarks
Comment Optional Not available You can write a short description of this adapter.
The description will be reflected in the specifications.
 

Schema

Input Schema

The number of columns varies depending on the [Format]
See "Schema of Table Model" for details regarding schema structure.

Output Schema

None.

Loading schema in Mapper

Schema is loaded automatically.
For any details, please refer to the 'Editing Schema'

Transaction

Transaction is supported.

Transaction is enabled only when [Execute transaction processing] in [Transaction] is checked.

PSP Usage

PSP is supported.
For details on PSP, refer to "Parallel Stream Processing".

Available component variables

Component variable name Description Remarks
count Return the number of lines of written data.
  • The value defaults to null.
message_category Stroes the category to which corresponding message code belongs to, when an error occurs.
  • The value defaults to null.
message_code Stores its corresponding message code of occured error.
  • The value defaults to null.
message_level Stores the severity of the corresponding message code of the occured error.
  • The value defaults to null.
error_type Stores the type of the occured error.
  • The value defaults to null.
  • Error is represented in the format depicted below.
    Example:java.io.FileNotFoundException
  • The message may vary depending on the DataSpider Servista version.
error_message Stores the error message for the occured error.
  • The value defaults to null.
  • The message may vary depending on the DataSpider Servista version.
error_trace Stores stack trace of the occurred error.
  • The value defaults to null.
  • The message may vary depending on the DataSpider Servista version or the client application used.

Specification Limits

Main exceptions

Exception name Cause Solution
InputDataNotFoundException [Input data] is not specified. Specify the [Input data], or draw the data flow.
ResourceNotFoundException
Resource definition could not be found.Name:[]
The [Format] is not specified. Specify the [Format].
ResourceNotFoundException
Resource definition could not be found.Name:[<Global Resource Name>]
The resource definition specified in the [Format] is not found. Make sure the global resource specified in the [Format].
InvalidPropertyConfigurationException
<Property name> is not specified.
[<Property name>] is not specified. Specify the [<Property name>].
FileIsDirectoryException Path input in [File] is directory. Input file path in [File].
FileAlreadyExistedException The file specified in [File] already exists. Change the name of the file specified in the [File] or Check [Overwrite] in the [Write settings].
FileIsLockedException The file specified in [File] is locked. Unlock it from Explorer or CLI.
ArrayIndexOutOfBoundsException The field number of the column list specified in the [Format] may be bigger than the column number of input source XML data. Please check the number of columns of data or column list or the number of fields of XML input source specified [Format].
java.io.FileNotFoundException
Another processing is in use.
File specified in [File] is being used by another process. Please check whether it is used by other processing.
java.io.UnsupportedEncodingException The encoding that is not supported is specified in [Encoding]. Specify an encoding that is supported in Java SE Runtime Environment 8.
Refer to "Supported Encodings"(http://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html) for details.
IllegalPaddingException
Padding character did not fit in the filed.
As a result of padding applied to data, the total length of the data exceeded the length of the field. Ensure the settings for padding characters and input data are correct.
java.lang.ArithmeticException
/ by zero
Padding has failed as no padding character is defined. Ensure the settings for padding characters and input data are correct.

Notes