FixedLength
See the following sections to parse fixed-length input or format fixed-length output. You need to use fixed-length streams to use the EBCDIC encoding. The Flow Service also provides alternative character encodings.
- Setting Stream Properties
- Defining Stream Fields
- Using the Flow Service's Alternative Character Encodings
Setting Stream Properties
You can set the following properties to parse the format of fixed-length input or to format fixed-length output. Select the necessary component and expand the Format property in the Stream pane.
| Property name | Value | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Start Row | Specify the line number of the first record. By default, the value is 1. If the first line of the data contains a header row, enter 2. | ||||||||||||
| Number of Fields | Specify the number of fields each record in the stream contains. The default value is 3. | ||||||||||||
| Output Encoding | Select an encoding or enter an alternative encoding to process data from the host system.
|
||||||||||||
| Record Delimiter | Select the delimiter that separates the records.
|
||||||||||||
| Linefeed | Select the linefeed that separates the records in the output data. This property is only valid when writing to a file. Also, CR+LF linefeed is not supported when reading.
|
||||||||||||
| Record Length | Set the Record Delimiter property to Record Length and specify the length to separate the records. The default value is 256. | ||||||||||||
| PackedSign Presence | Specify whether packed decimals contain the sign.
|
||||||||||||
| PackedSign Format | Specify the format for the sign of a packed decimal.
|
||||||||||||
| ZonedSign Presence | Specify whether zoned decimals contain the sign.
|
||||||||||||
| ZonedSign Format | Specify the format for the sign of a zoned decimal. The format is the same for input and output. You can use this option with the Output Encoding property when Output Encoding is not set to "ebcdic".
|
Defining Stream Fields
Define the following properties for the fields of fixed-length streams:
| Field name | Specify the field name. | ||||
|---|---|---|---|---|---|
| Type | Select String, Boolean, Integer, Double, Decimal, DateTime, Binary, ZonedDecimal, or PackedDecimal. Or, if you specified one of the alternative encodings for the Output Encoding stream property, you can select from one of the following:
|
||||
| Start Pos | Specify the starting position of the field from the beginning of each record, as a 0-based index. | ||||
| Length | Specify the length of the field in bytes, unless you've set Output Encoding to UTF-16. Specify the length with the number of characters for UTF-16. | ||||
| Fraction Length | Enter the precision -- the number of decimal places. You can only set this property when the Type property is set to ZonedDecimal or PackedDecimal. |
Validating Field Names
Note the following conditions for a field name to be valid:
/ can't be used.- There isn't a limit to the length of the name.
- The name is case sensitive.
- You can use the single-byte space character and multibyte characters.
Note
- Outputting null fields: If the Record Delimiter property is Linefeed and the component is reading a file that contains less fields than the number of fields in the field definition, the missing fields are output as null fields. If the file contains more fields than the number of the stream's field definitions, the extra fields are ignored.
-
Outputting blank fields: If the Record Delimiter property is RecordLength and the length of the records in a file is shorter than the stream's Record Length property, the missing fields are output as blank fields.
Using the Flow Service's Alternative Encodings
The Flow Service provides the following additional encodings. The encoding names and their character sets are below. These character sets are tables for converting to Windows-31J -- see the notes below.
- Character Mapping Notes
- Setting the Stream's Encoding
- Setting Field Data Types for Alternative Encodings
| AS-CP00930 | IBM CP00930 (CP00290 + CP00300) |
|---|---|
| AS-CP00930-EX | AS-CP00930, adjusted for Windows OS. |
| AS-CP00939 | IBM CP00939 (CP01027 + CP00300) |
| AS-EBCDIC-JEF | EBCDIC + Fujitsu JEF |
| AS-EBCDIK-JEF | EBCDIK + Fujitsu JEF |
| AS-EBCDIC-JIPSE | EBCDIC + NEC JIPSE |
| AS-EBCDIK-JIPSE | EBCDIK + NEC JIPSE |
| AS-EBCDIC-KEIS | EBCDIC + Hitachi KEIS Don't use this encoding. Use AS-EBCDIC-KEIS-2 instead. |
| AS-EBCDIK-KEIS | EBCDIK + Hitachi KEIS Don't use this encoding. Use AS-EBCDIK-KEIS-2 instead. |
| AS-EBCDIC-KEIS-2 | EBCDIC + Hitachi KEIS |
| AS-EBCDIK-KEIS-2 | EBCDIK + Hitachi KEIS |
Note
- The Flow Service makes some corrections to do the conversion.
- The 2-byte character table includes only the characters from JIS X 208.
Character Mapping Notes
Note the following character mappings:
Linefeed
The Flow Service maps 0x15 (NEL) to \u0A, instead of \u85. This is to handle the problem that linefeeds can't be processed when Unicode is mapped to Windows-31J -- the problem that linefeeds can't be processed because they aren't 0x0A.
Yen Symbol and Backslash
The Flow Service maps EBCDIC's yen symbol to \u5C, instead of \uA5. This is to handle the problem that yen symbols can't be processed when Unicode is mapped to Windows-31J -- the problem that the yen symbol can't be processed as a yen symbol because it isn't 0x5C. Note that backslash is mapped to \u5C, as well.
Tilde and Overline
The Flow Service maps EBCDIC's tilde to \u7E -- \u7E is mapped to 0x7E in Windows-31J. Note that the overline is mapped to \u5E.
Setting the Stream's Encoding
You can set the stream's output encoding to process character sets on the host system. Select the encoding in the Output Encoding property. Or, enter one of the Flow Service's alternative encodings in the property field.
Selecting Field Types for Alternative Encodings
You can select String(X) and String(N) in the Type menu when you enter an alternative encoding in Output Encoding.
Note
-
Output: When you select an alternative encoding as the Output Encoding property, the Flow Service's Unicode characters are converted to characters in the alternative encoding, and after the conversion, the shift-in and shift-out are removed, depending on whether you select String(N) and String(X) as the field type.
-
Input: The conversion from String(N) to the Flow Service Unicode character adds the shift-in and shift-out to the front and end and then begins the conversion using the specified character encoding. Therefore, a String(N) type field that includes text with single-byte characters will be garbled.