You can use the extdat statement to use the following extended functions with input data files in the DAT format:
When you specify the extdat statement, then, whether or not the operands are specified, you can change the enclosing character and use all extended functions other than capability to store decimal-point data in INTEGER or SMALLINT columns.
- Entering the null character (0x00), linefeed symbol (0x0a), and carriage-return symbol (0x0d0a) in character, national character string, and mixed character string data types
- Entering data with an enclosing character (") specified in the numeric, date interval, and time interval data types
- Deleting single-byte spaces and tabs from the input data section of columns of the numeric, date, date interval, time, and time interval data types
- Changing the enclosing character
- Entering the enclosing character itself (two consecutive enclosing characters are treated as one data item)
- Storing decimal-point data in INTEGER and SMALLINT columns
The enclosing character is the character specified in the enclose operand of the extdat statement. When this operand is omitted, the double quotation mark (") is used as the enclosing characters.
If the data immediately before or after a separator character is closed in the enclosing characters, the enclosing characters are not input. However, any enclosing character contained in the character string that is enclosed in the enclosing characters is input.
In the DAT format, the double quotation marks are used as the enclosing characters (you cannot change this enclosing character).
- Criterion
- Specify the extdat statement to use the above extended functions for a DAT-format input data file.
- Organization of this subsection
- (1) Format
- (2) Explanation
- (3) Description of the extended functions
(a) enclose=enclosing-character
<character string> ((1 byte))
Specifies the enclosing character to be used to enclose each column value of the input data.
- Rules
- If data immediately before or after the separator character is enclosed by the enclosing characters, those enclosing characters are not input.
- To treat an enclosing character as data, specify the enclosing character twice in succession. For example, if the single quotation mark (') is the enclosing character, specify two consecutive single quotation marks ('').
- There are differences in the handling of enclosing characters between the DAT and extended DAT formats. For details about the entry of input data and handling of enclosing characters, see 5.5.1 DAT format.
- None of the following characters can be specified as the enclosing character:
- Space, tab, asterisk (*)
- Character used as the separator character
- In the case of Shift JIS Kanji codes, the following characters are not suitable for the enclosing character because they may duplicate input data codes:
- Characters used in the data in the input data file
- Characters that can occur as Japanese input character codes
![[Figure]](figure/zu050085.gif)
- Double-byte codes cannot be specified, because the enclosing character must be a single-byte code.
(b) decin={yes|no}
Specifies whether or not data with a decimal point is to be stored in INTEGER and SMALLINT columns.
- yes:
- Store data with decimal point.
- When yes is specified, the extdat statement treats all characters up to the first decimal point as data and ignores all subsequent characters; it does not check the format. The value that is actually stored is the integer with all decimal places discarded.
- no:
- Do not store data with decimal point.
- When no is specified, the extdat statement treats any data with decimal point as erroneous data and does not store it in an INTEGER or SMALLINT column.
(a) Entering the null character (0x00), linefeed code (0x0a), and carriage-return code (0x0d0a) in character string data, national character string data, mixed character string data, or BINARY type
If the input data of the character string data, national character string data, mixed character string data, or BINARY type is enclosed in the enclosing character, the utility treats the null character (0x00), linefeed code (0x0a), and carriage-return code (0x0d0a) as data. If the input data is not enclosed in the enclosing character, the utility treats the null character, linefeed code, and carriage-return code as delimiters for data or the end of line.
For example, suppose CHAR(16) data is "California\0Napa". If you specify the extdat statement, California\0Napa is entered; otherwise, you cannot enter this data.
(b) Entering data with the enclosing character (") specified in the numeric, date interval, and time interval data types
You can enter data of the numeric, date interval, and time interval data types even when the data contains an enclosing character ("). In the DAT format, you cannot enter such data.
(c) Deleting single-byte spaces and tabs from the input data section of columns of the numeric, date, date interval, time, and time interval, and time stamp data types
The utility deletes all single-byte spaces and tabs from the input data section of columns of the numeric, date, date interval, time, and time interval, and time stamp data types. For details about the handling when the entire data is single-byte spaces or tabs, see 5.9 Null and default values during data loading.
(d) Changing the enclosing character
The utility treats the character specified in the enclose operand as the enclosing character.
(e) Entering the enclosing character itself
The utility treats any two consecutive enclosing characters as a single data item. This rule also applies to multi-byte codes. If a code assigned to a Gaiji character matches an enclosing character, the code may result in an input data error. In such a case, you must change the enclosing character.