Structure of the Data Rows

The output record data fields are represented in the template by table rows.

In FIXED_POSITION_BASED templates, each row has the following attributes (or columns):

The first five columns are required and must appear in the order listed.

For DELIMITER_BASED templates, each data row has the following attributes (columns):

The first three columns are required and must be declared in the order stated.

In both template types, the Comments column is optional and ignored by the system. You can insert additional information columns, because all columns after the required ones are ignored.

The usage rules for these columns are as follows:

Position

Specifies the starting position of the field in the record. The unit is in number of characters.

This column is only used with FIXED_POSITION_BASED templates.

Length/Maximum Length

Specifies the length of the field.

The unit is in number of characters. For FIXED_POSITION_BASED templates, all the fields are fixed length. If the data is less than the specified length, it is padded. If the data is longer, it is truncated. The truncation always occurs on the right.

For DELIMITER_BASED templates, this value specifies the maximum length of the field. If the data exceeds the maximum length, it is truncated. Data is not padded if it is less than the maximum length.

Format Column

Format Column specifies the data type and format setting.

There are three accepted data types:

  • Alpha

  • Number

  • Date

Refer to Field-Level Key Words for their usage.

Number Data Type

Numeric data has three optional format settings: Integer, Decimal, or you can define a format mask.

Specify the optional settings with the Number data type as follows:

  • Number, Integer

  • Number, Decimal

  • Number, <format mask>

    For example:

    Number, ###,###.00
    

The Integer format uses only the whole number portion of a numeric value and discards the decimal. The Decimal format uses only the decimal portion of the numeric value and discards the integer portion.

The following table shows examples of how to set a format mask. When specifying the mask, # represents that a digit is to be displayed when present in the data; 0 represents that the digit placeholder is to be displayed whether data is present or not.

When specifying the format mask, the group separator must always be "," and the decimal separator must always be "." To alter these in the actual output, you must use the Setup Commands NUMBER THOUSANDS SEPARATOR and NUMBER DECIMAL SEPARATOR. See Setting Up Command Tables for details on these commands.

The following table shows sample Data, Format Specifier, and Output. The Output assumes the default group and decimal separators.

Data Format Specifier Output

123456789

###,###.00

123,456,789.00

123456789.2

###.00

123456789.20

1234.56789

###.000

1234.568

123456789.2

#

123456789

123456789.2

#.##

123456789.2

123456789

#.##

123456789

Date Data Type

The Date data type format setting must always be explicitly stated. The format setting follows the SQL date styles, such as MMDDYY.

Mapping EDI Delimiter-Based Data Types to eText Data Types

Some EDI (DELIMITER_BASED) formats use more descriptive data types.

These are mapped to the three template data types as shown in the following table.

ASC X12 Data Type Format Template Data Type

A - Alphabetic

Alpha

AN -Alphanumeric

Alpha

B - Binary

Number

CD - Composite data element

N/A

CH - Character

Alpha

DT - Date

Date

FS - Fixed-length string

Alpha

ID - Identifier

Alpha

IV - Incrementing Value

Number

Nn - Numeric

Number

PW - Password

Alpha

R - Decimal number

Number

TM - Time

Date

Assume the setup commands shown in the following table.

Name Command

NUMBER THOUSANDS SEPARATOR

.

NUMBER DECIMAL SEPARATOR

,

The following table shows the Data, Format Specifier, and Output for this case. Note that the Format Specifier requires the use of the default separators, regardless of the setup command entries.

Data Format Specifier Output

123456789

###,###.00

123.456.789,00

123456789.2

###.00

123456789,20

1234.56789

###.000

1234,568

123456789.2

#

123456789

123456789.2

#.##

123456789,2

123456789

#.##

123456789

Pad

Pad applies to FIXED_POSITION_BASED templates only. Specify the padding side (L = left or R = right) and the character. Both numeric and alphanumeric fields can be padded. If this field is not specified, Numeric fields are left-padded with "0"; Alpha fields are right-padded with spaces.

Example usage:

  • To pad a field on the left with a "0", enter the following in the Pad column field:

    L, '0'

  • To pad a field on the right with a space, enter the following the Pad column field:

    R, ' '

Data

Specifies the XML element from the data extract that is to populate the field. The data column can simply contain the XML tag name, or it can contain expressions and functions.

For more information, see Expressions, Control Structures, and Functions.

Tag

Acts as a comment column for DELIMITER_BASED templates.

It specifies the reference tag in EDIFACT formats, and the reference IDs in ASC X12.

Comments

Use this column to note any free form comments to the template. Usually this column is used to note the business requirement and usage of the data field.