Write Variable-Length File

Operation Name

Write Variable-Length File

Function overview

Writes the input data to variable-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 variable-length.

Click [Browse] button to activate the file Selectr and Select the file.
Delimiter mode Required Not available Select how to specify the delimiter.
  • [Select from list]: (Default)
    Select delimiter character from the list.
  • [Enter directly]:
    Input the delimiter character directly into the field.
  • [Enter character code]:
    Input delimiter character into field with character code.
  • Specified by the method selected, the corresponding input fields ([Delimiter list] / [Delimiter]) switches.
Delimiter list Optional Not available Select a delimiter character.
  • [Space]: (default)
  • [TAB] (Tab):
  • [Comma]:
  • [Semicolon]:
  • [Slash]:
  • [New line]:
  • Enables when you select [Delimiter mode] from [Select from list].
Delimiter Optional Available Enter a delimiter character.
  • [Enter directly] case
    Directly input from the keyboard.
  • [Enter character code] case
    [Encoding] Specifies the encoding specified by the byte sequence.

    Octal (prefix "0" <zero digit>), decimal (no prefix), hexadecimal (prefix "0x" <X of the alphabet and the number zero> or "#") input is available .
    If padding is composed of multiple bytes, input with being separated by commas.Ex.: 0x10, 0x13
  • Enables when [Enter character code] or [Enter directly] are selected in [Delimiter mode].
Double quote escape Required Not available Select whether to make the double quote escape.
  • [Disable]: (default)
    No double-quote escape.
    Delimiter can not be held as field value.Delimiter can not be held as field value.
  • [Enable]:
    Perform double-quote escape.
    The field delimiter, if contains quotes or double quotes around field values.
    Double quotes if it contains a field value represented by two letter quotes a letter quotation marks.
  • Across the field in double quotes, double quotes, or if there is no delimiter in the field you want to escape is an error.
Format Required Not available Select a file format definition that is variable with global resources.
How to set the "Variable-length Writing Wizard" Please for more information.
  • [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 read 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
  • [CR]:
    Primarily Mac OS (Version 9)
  • [LF]:
    Primarily UNIX/Linux
  • [CR+LF]:
    Primarily Microsoft Windows
  • The line code [Encoding] to be encoded in the encoding specified by the byte value depends on encoding.
    • LF
      Specify 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
      Specify 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
      Specify 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 Remarks
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.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.
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.

Notes