The Data Element is the smallest data structure in the standard. It not
only carries the actual data value, but also contains the properties that
describe the data. There are two types of data elements:
Simple data element
. Simple data elements are stand alone data elements in a data segment.
Component data element. Sometimes referred to as sub
elements, component data elements makes up the collection of data elements
in a composite data element structure.
Simple data elements and component data elements are fundamentally the same, but
differ under the following:
Different parent structure
. The simple data element belongs to the data segment, while the
component data element belongs to the composite data structure.
Repeating capability. The simple data element can have multiple
repeating instance under the data segment parent. Meanwhile, a component
data element cannot repeat under the composite element parent.
Outside of the difference above, in a nutshell, one can view all
elements as simple data elements, and should they become part of a
composite data structure do they become component data elements. A data
element can both be a simple data element and a component data element.
The data element has the following properties:
Identifier. A unique identifier that uniquely identifies the
data element from other elements.
Name. The name of the data element.
Minimum Length
. The minimum length of the value the data element can hold.
Maximum Length
. The maximum length of the value the data element can hold.
Data Type. The data type of the value the data element can
hold.
Value. The value of the data element.
In the context of a data segment or a composite element, the data element has
the following additional properties:
Position. The position of the data element relative to other
elements in the collection. The data elements appear in the order of
their sequential position.
Requirement. The required presence of the data element at
the specified position as defined by the standard.
User Requirement. The custom requirement of a data
element's presence at the specified position as implemented by a trading
partner. This requirement supersedes the standard Requirement,
that is, if the standard requirement designates that the data element is
optional (O,C) but the User Requirement indicates that it must be
used (MUST USE) then the presence of the data element is required.
The data element is considered present if it has at least one character in its
value. The following is a list of allowed user requirements:
MUST USE
USE
NOT USED
DEPENDENT
RECOMMENDED
NOT RECOMMENDED
Maximum Repeat. The number of times the data element can occur
at the same position. If the data element does not have repeating
instances then this value is one. This is applicable to simple data
elements only; not applicable to component data elements.
Some data elements are constrained to having a list of values. This list
of code values is part of the data element definition, and it is in error if a
data element should contain a value not part of this list. The values in
this list conform to the data requirement specified for the data element.
That is, they are within the minimum and maximum length of characters, and they
are of the same data type.
Data Types
The following data types are available for the controlling agencies.
Numeric (Nn) – The data type represents a decimal number where the
decimal point is implied. The decimal number is represented as a whole
number. The second character (n) in the symbol specifies the position of
the decimal point – not shown but implies the number of decimal positions to
the right of the decimal point. For example, the decimal number 234.56 that is
stored in data element of data type N3 would be represented as 234560.
Decimal (R) – The data type represents a decimal number where the
decimal number is stored in the data element with the decimal point explicitly
included in the data.
Identifier (ID) – The data type represents data that belongs to a
predefined list.
String (AN) – The data type represents a combination of alphanumeric
characters, which can contain spaces. The leading character cannot be a
space.
Date (DT) – The data type represents a date in the format CCYYMMDD
where CC represents the century, YY represents the year, MM is month, and DD is
the day. In earlier versions of the standard, the date is stored as YYMMDD.
Time (TM) – The data type represents time in the format HHMMSSd..d
where HH is the hours in 24 hour clock, MM is the minutes, SS is the seconds
and ddd is the decimal seconds.
Binary (B) – The data type represents any data, which can be
represented as binary.
Data Length
The length of data is the number of characters in the value. One graphic
character is counted as one character. Chinese and
Japnaese characters may constitue two or three bytes for a single
graphic character, which still counts as one character. The following
exceptions apply where some characters are not included in the count:
The “+” sign that indicates that the number is positive should be suppressed
from the data stream, but if it does occur, it is not included in the data
length count.
The “-“ sign that indicates that the number is negative is not included in the
data length count.
The decimal point is not included in the data length count.
The trailing exponent indicator “E” is not included in the data length count.
Example, 1E3.
Plus and Minus Signs
For decimal and numeric data types the minus/hyphen (“-“) sign preceding a
number signifies a negative value while the plus (“+”) sign signifies a
positive value. When no sign precedes the number, it is taken as a positive
value. When transmitting any number that is positive, the “+” should always be
suppressed.
Leading and Trailing Zeros
For decimal and numeric data types, leading zeros should be suppressed unless
required to satisfy a minimum length requirement. For EDIFACT, when a decimal
point precedes the first digit in the number, a single leading zero is required
(example, 0.123). For X12, this leading zero is suppressed (example .123).
When only zeros follow a decimal point, the trailing zeros should be suppressed.
However, if it becomes necessary to include the decimal point a single zero
should follow the decimal point (example 123.0). Zeros after the decimal to
indicate precision is also allowed.
For time data type in X12, the trailing zeros can also be used in decimal
seconds to satisfy the minimum length requirement.
Triad Separators
For decimal and numeric data types, triad separators are not allowed. For
example, the value "5,000,000,000" must be represented as "5000000000".
Spaces
For string, identifier, alphabetic and alphanumeric data types, trailing spaces
are suppressed. An element containing only spaces as its value is
illegal.