8.12. UCC/EAN-128

8.12.1. Introduction

UCC/EAN128[2] 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 is the AI for SCC-14 case codes. The value is 19421123450011.

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

10 is the AI for Batch Number. The value can have variable length. 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. The AI also defines how to make up to the required length. In most cases, leading zeros are inserted to the data.

When the data length can be derived from the 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 is served as the field separator.

8.12.2. How Monterey Barcode Creator Implements UCC/EAN-128

To understand each data field, the Monterey Barcode Creator requires you to enter the data in a special format. The AI must be enclosed with parentheses. From the AI, Monterey Barcode Creator knows whether a field has a fixed length or a variable length. For all variable-length fields, Monterey Barcode Creator inserts field separator unless it is located at the end of the symbol.

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

Table 8.4. List of Known AIs

AI Comment Data Limitation
00 SSCC-18 numeric, fixed 18 digits
01 SCC-14 numeric, fixed 14 digits
02 Item Number numeric, fixed 14 digits
10 Batch/Lot Number alpha-numeric, variable 20 characters
11, 13, 15, 17 Dates numeric, fixed 6 digits in YYMMDD format
20 Product Variant numeric, fixed 2 digits
21 Serial Number alpha-numeric, variable 20 characters
22 HIBCC alpha-numeric, variable 29 characters
23d Lot Number numeric, fixed length (the length limits depends on the digit d)
240, 250   alpha-numeric, variable 30 characters
30 Quantity numeric, fixed 8 digits
310-316, 320-329, 330-336, 340-349, 350-356, 260-369 Various measurement units numeric, fixed 6 digits
37   numeric, fixed 8 digits
400 Purchase Order alpha-numeric, variable 30 characters
410, 411, 412, 414   numeric, fixed 13 digits
420, 421   alpha-numeric, variable 9 or 13 characters
8001   numeric, fixed 14 digits
8002   alpha-numeric, variable 20 characters
8003, 8004   alpha-numeric, variable 30 characters
8005   numeric 6 digits fixed
8100 Coupon Extended Code numeric fixed 6 digits
8101 Coupon Extended Code numeric, fixed 10 digits
8102 Coupon Extended Code numeric, fixed 2 digits

If the AI is not listed in the table above, Monterey Barcode Creator can not know whether its data length is fixed or variable. Thus, the Monterey Barcode Creator 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(99)123456(15)051210. The Monterey Barcode Creator understands that 01 AI requires fixed-length 14 digits data and AI 15 requires fixed-length 14 digits data. However, Monterey Barcode Creator does not understand the AI 99 and treats this field as if it has a variable length. The Monterey Barcode Creator 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 Monterey Barcode Creator 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(99)123456~(15)051210

When the Monterey Barcode Creator 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!(99)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(99)123456~(15)051210

01942112345001229912345615051210

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

0194211234500122[ GS]99123456[ GS]15051210

(01)94211234500122(99)123456(15)051210

019421123450012299123456[ GS]15051210

8.12.3. Auto Check Digit

SCC-14 (AI=01) and SSCC-18 (AI=00) require the data to end with a check digit. When the property UccEanOptionalCheckDigit is TRUE, and Monterey Barcode Creator finds that the data length is exactly one less than the required length, it calculates the check digit and appends it at the end of the data. The check digit also appears in the human readable text. For example, the SCC-14 code (01)94211234500122 can be entered as (01)9421123450012.

Note

Monterey Barcode Creator does not verify if the last check digit is correct,if you enter the data in full. For example, if you enter the data as 94211234500129, the Monterey Barcode Creator encodes the data as is, regardless the value of UccEanOptionalCheckDigit.

8.12.4. Input Format

To create the barcode correctly, you must enclose the AI with parentheses ( ). The Monterey Barcode Creator 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 5432112000(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. Monterey Barcode Creator ignores the spaces during the encoding, but preserves them in the human readable text, as the one below illustrates:

8.12.5. Validation

Monterey Barcode Creator 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 Monterey Barcode Creator 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 Monterey Barcode Creator and requires only numeric or alpha-numeric data, check if the data part meets the requirement.

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

8.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 8.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 in the starting message. When this is the case, remove ~1 at the beginning of the input.



[2] As UCC/EAN orgnization changes its name to GS1, now the code is also referred as GS1 128.