The ediDataElement object can represent either a composite element or a simple data element. A simple data element is the smallest structure in the standard,
which not only carries the actual business data, but also contains properties that describe the
data. A composite element contains a collection of simple data elements. A
data element has these following properties:
Unique identifier that permanently and uniquely identifies the data element.
Description that describes the data element.
Minimum length of the data that the data element can hold.
Maximum length of the data that the data element can hold.
Data type of the data element.
For some data elements, a list of data that the data element can
contain.
Data Types in X12 standard
For ASC/X12 the following data types are available:
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 Types in EDIFACT standard
For UN/EDIFACT the following data types are available:
Alphanumeric (an) – The data type represents data that is a combination of alphabetic or numeric characters.
Alphabetic (a) – The data type represents data that is a combination of alphabetic characters.
Numeric (n) - 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.
Data Length
The length of the data element basically counts the number of graphic character in the data. For decimal and numeric data types, the following apply:
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. Example. 5,000,000 is not allowed and should be replaced with 5000000.
Spaces
For string, identifier, alphabetic and alphanumeric data types, trailing spaces are suppressed.
Methods
ExportValue - Exports the value to an external file.
First -
Gets the first data element in the collection.
FileValue -
Gets or sets the value of a data element using data from a file object.
GetRepeatInstance -
Gets the repeating instance of the data element.
ImageValue -
Gets or sets the value of the data element as an image file.
ImportValue - Imports the data of an external file into the value.
Last -
Gets the last data element in the collection.
Next -
Gets the next data element in the collection.
Previous -
Gets the previous data element in the collection.
Properties
DataElements -
Returns the object containing the collection of component or sub elements.
DataLength - Returns the length of the data element value.
DataType - Returns the data type of the data element.
Definition -
Returns the matching definition object of the data element from the schema.
Description - Returns the description or name of the data element.
HexValue - Returns the
hexadecimal value of the data element.
IndexNumber -
Returns the index location of the data element in the collection.
IsComponent - Indicates if the data element is a
component data element.
IsComposite -
Indicates if a data element is a composite data element.
MaximumLength - Returns the maximum length of the value that
the data element is allowed.
MinimumLength - Returns the minimum length of the value that
the data element is allowed.
Position - Position number of the data element or component element in a data segment or composite element respectively.
RepeatCount - Returns the number of instances the data element has
been repeated. This value is valid only for the first instance of the element,
otherwise it returns zero.
RepeatNumber -
Returns the instance of the element in the repeating sequence. The first instance has a repeat number of 1.
Requirement -
Returns the standard requirement of the data element's presence at its
position in the collection.
UserRequirement -
Returns the user requirement of the data element's presence at its position in
the collection.
Value - Gets or sets the value of
the data element.