ANSI X12 Business Document

The data types that you can apply depend on the data class. In turn, the possible data classes depend on the structure type of the Business Document. For more information, see Business Document structure, Business Documents, and Axway Mapping Services DML Reference Guide

Data class Data type Definition
field
Physical
length
Plus sign
in inputs
Plus sign
in outputs

Boolean

Boolean [0,1]

1

1 N/A N/A

Date & Time

Date
[YYYYMMDD]

8
(indicates
a date)

8 N/A N/A

Date
[YYMMDD]

6
(indicates
a date)

6 N/A N/A

Time
[hhmm]

10
(indicates
a time)

10 N/A N/A

Time
[hhmmss]

8
(indicates
a time)

8 N/A N/A

Time
[hhmmssqq]

8 (indicates
a time)

8 N/A N/A

Integer

Integer (len)

0,10

P+1 if +
sign
present,

P if +
sign not
present

Optional.
If
activated...
...never
generated.

Real number

Numeric [len],s
virtual scale
real

[6,18],6

P+1 if +
sign
present

P if +
sign not
present

Optional.
If
activated...
...never
generated.

Real (len)
virtual scale
real

0,10

P+2 if +
sign and
Decimal
character
present

P if +
sign not
present

P+1 if +
sign and
Decimal
character
absent

P if +
sign
absent

Optional.
If
activated...
...never
generated

String

alphaNumeric (len)

255 255 N/A N/A

Identifier (len)

255 255 N/A N/A

Very large
object

Binary (len)

255 255 N/A N/A

Logical data types are defined by a DML data class and a DML data type. The pattern allows you to refine the definition of the data type. For example, pattern p means precision. A precision must be entered in the definition. In the X12 standard, the length of a decimal data type element does not include the optional leading sign or decimal point. The X12 element length is not the physical length of the field, but the precision of the field. It is the total number of digits.

X12
standard
type
DML data class DML data type Pattern Definition
N0, N I=Integer Integer(len) p X12_maxlen
  I=Integer Integer(len) pMin,pMax X12_minlen,
X12_maxlen
N1, N2,
..., Nx
R=Real
number
Numeric [len],s [pMin,pMax],s X12_minlen, X12_maxlen,x
AN S=String Alphanumeric
(len)
pMin,pMax X12_minlen,
X12_maxlen
R R=Real
number
Real (len) pMin,pMax X12_minlen,
X12_maxlen
Rx Not currently supported in X12 repository.

You can use both Real and Integer numbers to create an X12 Business Document. You can also use the values in the following table to configure your document for the data types from the X12 standard. For additional information, see Set node attributes values.

Data type N, N0 N2 R
Properties> General
Pad Reals with a leading and trailing zero (2) N/A N/A Unchecked box icon
Keep decimal separator character Unchecked box icon Unchecked box icon Unchecked box icon
Keep decimal separator Unchecked box icon Unchecked box icon Unchecked box icon
Keep + sign for positive
Real numbers
Unchecked box icon Unchecked box icon Unchecked box icon
Keep + sign for positive
Integer numbers
Unchecked box icon Unchecked box icon Unchecked box icon
Business Document Leaf elements
Class (R=Real, I=Integer) I R R
Data type (R=Real(len); N=Numeric[len],s ; I=Integer(len)) I 1 N 1 R 1
Pattern P [pMin,pMax],s pMin,pMax
Definition 5 [1,5],2 1,5
Properties > Attributes
Optional plus sign (3) Checked box icon Checked box icon Checked box icon
Plus sign position leave it blank leave it blank leave it blank
Justification leave it blank leave it blank leave it blank
Padding character leave it blank leave it blank leave it blank
Keep number of fractional digits Unchecked box icon Unchecked box icon Unchecked box icon
Keep decimal separator character Unchecked box icon Unchecked box icon Unchecked box icon
Keep decimal separator Unchecked box icon Unchecked box icon Unchecked box icon
Keep + sign for positive
numbers, Real or Integer
Unchecked box icon Unchecked box icon Unchecked box icon
Input value 12345 12345 123.45
Output value 12345 12345 123.45
Input value +12345   +123.45
Output value 12345   123.45
Input value -12345 -12345 -123.45
Output value -12345 -12345 -123.45
Input value 123456 (4) 123456 (4) 1234.56 (4)
Output value Error, no output Error, no output Error, no output

(1) The real(len), numeric[len], integer(len) cannot be customized because they are the default types for X12.

(2) This option is used to generate the non-significant digit on the right side or the left part of the decimal separator. For example, if you have a canonical value of:

  • .2 a zero is generated on the left: 0.2, for example.
  • 2. a zero is generated on the right: 2.0, for example.

(3) This option replaces the plus sign in the input value with a digit when reading the value.

(4) Unable to read this value because there are more digits than the definition allows.

Handling incomplete Date/Time fields

When simulating or running on the server a Mapping Flow which has an X12 Business Document as input, the DML version has an impact on padding incomplete Date/Time fields.

ACCEPT_INPUT_DOCUMENTS_WITH_ERRORS should be set to 1, otherwise the input message fails to be parsed.

The following padding is applied:

Date type Input Adjuted value DML version 2.1 Adjuted value DML version 1.5/2.0
YYYYMMDD 2014 18000101 20140101
YYYYMMDD 201408 18000101 20140801
YYYYMMDD 20140825 20140825 20140825
hhmmssqq 17 00000000 17000000
hhmmssqq 1735 00000000 17350000
hhmmssqq 173546 00000000 17354600
hhmmssqq 17354689 17354689 17354689

Related topics

Business Document types

Define X12 Business Documents

Business Document structure

Business Documents

Related Links