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

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.
utf-8 Unicode UTF-8
shift_jis Shift JIS
euc-jp EUC-JP
iso-2022-jp ISO-2022-JP
Windows-31J Windows-31J
ebcdic EBCDIC
Record Delimiter Select the delimiter that separates the records.
Linefeed Separate the records with the linefeed specified in the Linefeed property.
Record length Separate the records at the length specified in the Record Length property.
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.
Platform Output the linefeeds to the standard line-feed code for the platform.
CR+LF Output the linefeeds as CR+LF.
CR Output the linefeeds as CR.
LF Output the linefeeds as LF.
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.
Required in input. Always output. The sign nibble is always required in the input and is always output.
Optional in input. Always output. The sign nibble can be omitted from the input and is always output.
Optional in input. Don't output when positive. The sign nibble can be omitted in the input and isn't output when it's a positive sign.
PackedSign Format Specify the format for the sign of a packed decimal.
C (+), D (-) For input and output, the sign nibble is C in hexadecimal when the sign is positive and D in hexadecimal when the sign is negative.
A,C,E,F (+), B, D (-) For the input, valid values for the positive nibble are A,C,E, and F and valid values for the negative nibble are B and D. For the output, F is positive and D is negative.
ZonedSign Presence Specify whether zoned decimals contain the sign.
Required in input. Always output. The sign nibble is required in the input and is always output.
Optional in input. Always output. The sign nibble can be omitted from the input and is always output.
Optional in input. Don't output positive. The sign nibble can be omitted from the input and isn't output when the sign is positive.
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".
C (+), D (-) If the sign is positive, the sign nibble in the last digit is C in hexadecimal. If the sign is negative, the sign nibble in the last digit is D in hexadecimal. For example, -105 will become "31 30 D5".
EBCDIC compatible The string representation in EBCDIC is converted, as is, into ASCII characters. For example, -105 is "F1 F0 D5" in the EBCDIC encoding, with a string representation of "10N", so the field's value will be "31 30 4E" to represent "10N" in ASCII.

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:
String(X) The string that includes the shift code. The string's length includes the shift code's length.
String(N) A string that omits the shift code. The string's length excludes the shift code.
If you have set the Record Delimiter property to Linefeed, you can't select Binary or PackedDecimal here, or a compile error will occur.
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.

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.

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.

 

To the top of this page