10.12. UCC/EAN-128

10.12.1. Introduction

UCC/EAN-128[3] encodes structured data proposed by various industry standard organizations and authorized by UCC/EAN organization. Each data type is identified with a numeric value, called Application Identifier (AI). Multiple AIs and data values can be concatenated together into one barcode, such as:

(01)19421123450011(15)991231(10)101234

The data above contains multiple AIs and values:

  • 01 indicates that the data followed 19421123450011 is a SCC-14 number. [4]

  • 15 is the AI for Sell by Date. The value followed 991231 indicates that the Best Sell Date is December 31, 1999.

  • 10 is the AI for Batch Number. According to the specification, it is a variable length AI. Here the value is 101234.

The AI value determines the meaning and the length of the data part. Many of them encode a predefined length of data. For example, the SCC14 requires exact 14 digits and the Sell By Date requires exact 6 digits in YYMMDD format.

When the data length can be derived from AI, it is not necessary to add field separator (FNC1) in the barcode to separate two adjacent fields. However, if the first field has a variable data length, such a field separator is required. And in many applications it is often desirable to have a field separator between two fixed-length fields. The Code128 symbol character FNC1 serves this purpose.

10.12.2. How Barcode DLL implements the UCC/EAN-128

To understand each data field, Barcode DLL requires you to enter the data in a special format. The AI must be enclosed with parentheses. From the AI Barcode DLL knows whether a field has a fixed length or a variable length. For all variable-length fields, Barcode DLL inserts field separator unless it ends the input.

Barcode DLL also performs data validation on the AI and the data, if the AI is known to the program.

Table 10.4. List of Known AIs

AI Name Constraint Short Name
00 SSCC (Serial Shipping Container Code) n2+n18 SSCC
01 Global Trade Item Number n2+n14 GTIN
02 GTIN of Trade Items Contained in a logistic unit n2+n14 CONTENT
10 Batch or lot number n2+an..20 BATCH/LOT
11 Production date (YYMMDD) n2+n6 PROD DATE
12 Due date (YYMMDD) n2+n6 DUE DATE
13 Packaging date (YYMMDD) n2+n6 PACK DATE
15 Best before date (YYMMDD) n2+n6 BEST BEFORE or SELL BY
17 Expiration date (YYMMDD) n2+n6 USE BY OR EXPIRY
20 Product variant n2+n2 VARIANT
21 Serial number n2+an..20 SERIAL
22 Secondary data for specific health industry products n2+an..29 QTY/DATE/BATCH
240 Additional product identification assigned by the manufacturer n3+an..30 ADDITIONAL ID
241 Customer part number n3+an..30 CUST. PART NO.
242 Made-to-Order Variation Number n2+n..6 Variation Number
250 Secondary serial number n3+an..30 SECONDARY SERIAL
251 Reference to source entity n3+an..30 REF. TO SOURCE
253 Global Document Type Identifier n3+n13+n..17 DOC. ID
254 GLN Extension component n3+an..20 GLN EXTENSION
30 Variable count n2+n..8 VAR. COUNT
310n-369n (Trade and logistic measurements) n4+n6 --
337n Kilograms per square metre n4+n6 KG PER m2
37 Count of trade items contained in a logistic unit n2+n..8 COUNT
390(n) Amount payable - single monetary area n4+n..15 AMOUNT
391(n) Amount payable - with ISO currency code n4+n3+n..15 AMOUNT
392(n) Amount payable for a Variable Measure Trade Item - single monetary unit n4+n..15 PRICE
393(n) Amount payable for a Variable Measure Trade Item - with ISO currency code n4+n3+n..15 PRICE
400 Customer's purchase order number n3+an..30 ORDER NUMBER
401 Consignment number n3+an..30 CONSIGNMENT
402 Shipment Identification Number n3+n17 SHIPMENT NO.
403 Routing code n3+an..30 ROUTE
410 Ship to - deliver to Global Location Number n3+n13 SHIP TO LOC
411 Bill to - invoice to Global Location Number n3+n13 BILL TO
412 Purchased from Global Location Number n3+n13 PURCHASE FROM
413 Ship for - deliver for - forward to Global Location Number n3+n13 SHIP FOR LOC
414 Identification of a physical location Global Location Number n3+n13 LOC No
415 Global Location Number of the Invoicing Party n3+n13 PAY
420 Ship to - deliver to postal code within a single postal authority n3+an..20 SHIP TO POST
421 Ship to - deliver to postal code with Three-Digit ISO country code n3+n3+an..9 SHIP TO POST
422 Country of origin of a trade item n3+n3 ORIGIN
423 Country of initial processing n3+n3+n..12 COUNTRY - INITIAL PROCESS.
424 Country of processing n3+n3 COUNTRY - PROCESS.
425 Country of disassembly n3+n3 COUNTRY - DISASSEMBLY
426 Country covering full process chain n3+n3 COUNTRY - FULL PROCESS
7001 NATO stock number n4+n13 NSN
7002 UN/ECE meat carcasses and cuts classification n4+an..30 MEAT CUT
703(s) Approval number of processor with ISO country code n4+n3+an..27 PROCESSOR # s4
7003 Expiration Date and Time n4+n10 EXPIRY DATE/TIME
8001 Roll products - width, length, core diameter, direction, and splices n4+n14 DIMENSIONS
8002 Electronic serial identifier for cellular mobile telephones n4+an..20 CMT No
8003 Global Returnable Asset Identifier n4+n14+an..16 GRAI
8004 Global Individual Asset Identifier n4+an..30 GIAI
8005 Price per unit of measure n4+n6 PRICE PER UNIT
8006 Identification of the component of a trade item n4+n14+n2+n2 GCTIN
8007 International Bank Account Number n4+an..30 IBAN
8008 Date and time of production n4+n8+n..4 PROD TIME
8018 Global Service Relation Number n4+n18 GSRN
8020 Payment Slip Reference Number n4+an..25 REF No
8100 GS1-128 Coupon Extended Code - NSC + Offer Code n4+n1+n5 -
8101 GS1-128 Coupon Extended Code - NSC + Offer Code + end of offer code n4+n1+n5+n4 -
8102 GS1-128 Coupon Extended Code - NSC n4+n1+n1 -
90 Information mutually agreed between trading partners (including FACT DIs) n2+an..30 INTERNAL
91-99 Company internal information n2+an..30 INTERNAL

If the AI is not listed in the table above [5], Barcode DLL can not know whether its data length is fixed or variable. Thus, Barcode DLL treats the data as if its data length is variable and insert the field separator FNC1 when this field does not end the symbol.

For example, suppose that you set Message to (01) 19421123450011(8019)123456(15)051210. Barcode DLL understands that 01 AI requires fixed-length 14 digits data and AI 15 requires fixed-length 14 digits data. However, Barcode DLL does not understand AI 8019 and treats this field as if it has a variable length. Barcode DLL inserts a field separator at the end of this field (before AI 15).

Assuming that AI 99 requires a fixed data length and you'd like to reduce the overall barcode size, you can tell Barcode DLL that the field has a fixed data length by appending a tilde character ~ at the end of the field. For example, you can assign the value below:

(01)94211234500122(8019)123456~(15)051210

When Barcode DLL sees the ~, it treats the current field as fixed-length.

On the other side, if a known AI has a fixed data length but you'd like to have a field separator at the end of the field, you can do so by adding an exclamation character at the end of field, such as:

(01)94211234500122!(8019)123456(15)051210

It forces a field separator to appear after the SCC14 number even AI 01 has a fixed data length and the field separator is not required. Sometimes this field separator is desirable because it is easier for the application to parse the input.

See the table below for a comparision of results produced by different inputs. The[ GS] is the scanner output for FNC1 character.

Barcode Data input/Scanner output

(01)94211234500122(8019)123456~(15)051210

0194211234500122801912345615051210

(01)94211234500122!(8019)123456(15)051210

0194211234500122[ GS]8019123456[ GS]15051210

(01)94211234500122(8019)123456(15)051210

01942112345001228019123456[ GS]15051210

10.12.3. Auto Check Digit

Before version 3.4, Barcode DLL calculates mod10 check digi on SCC-14 and SSCC-18 numbers, but only When the property UccEanOptionalCheckDigit is TRUE. This behavior was changed in version 3.4. Now the program calculates mod 10 check digit automatically, regardless the value of UccEanOptionalCheckDigit. This renders this property useless.

Barcode DLL performs check digit calculation on those AIs: 00, 01, 02, 410, 411, 412, 413, 414, 415, and 8018.

10.12.4. Input Format

To create the barcode correctly you must enclose the AI with parentheses ( ). Barcode DLL only accepts numeric AI values. It reports an error when encountering a non-numeric character in the AI part. If AI does not appear in the known list (see the table above), and you do not want the data treated as variable length, you should tell so by appending a tilde character at the end of the field.

Some times, it is desirable to have the data separated by spaces in the human readable text. For example, you may like to see the human readable text (8101) 0 54321 1200(21)123456 instead of (8101)0543211200(21)123456. You can create the desirable human readable text by entering the message exactly like the one you'd like the human readable to be. Barcode DLL ignores the spaces during the encoding, but preserves them in the human readable text, as the one below illustrates:

10.12.5. Validation

Barcode DLL performs the following validations during the encoding process:

  • Check whether the AI is numeric.

  • Check whether a data part follows the AI.

  • If the AI is known to Barcode DLL and requires a fixed length of data part, check if the data part has the correct length.

  • Check whether the AI is enclosed with parentheses.

  • If the AI is known to Barcode DLL and requires only numeric or alpha-numeric data, check if the data part meets the requirement.

  • If the AI is know to Barcode DLL and requires variable length of the data, check if the length of the data exceeds the maximum size allowed.

10.12.6. Non-standard Application

If your application does not pass the validation, you can not use UCC/EAN-128 to encode the data. Nevertheless, since UCC/EAN-128 encoding is based on Code128 symbology, you can encode the data directly with Code128. Here are several hints you may consider when converting the EAN-128 data into a Code128 input:

  • An EAN-128 barcode starts with a FNC1 character. FNC1 can be entered with tilde code sequence ~1.

  • If you'd like to have the field separator encoded between two adjacent fields, using FNC1 character to separate two fields.

  • Code128 is capable of encoding spaces. Do not enter spaces in the input if you do not want them appear in the barcode.

  • You may use tilde code sequences to enter extended ASCII characters. See Section 10.11, “Code 128” for details.

For example, Code128 with message ~18101054321120021123456 produces the exact barcode as the one using UCC/EAN-128 with message (8101)0 54321 1200(21)123456.

Some non-standard applications do not encode the FNC1 at the starting message. When this is the case, remove ~1 at the beginning of the input.



[3] As UCC/EAN orgnization changed its name to GS1, now the symbology is also called as GS1-128.

[4] Also referred as GTIN (Global Trade Item Number)

.

[5] This table was updated in version 3.4 to reflect the changes made since the first version came out.