BARCODE (Bar Code) Keyword in Printer Files

Use this field-level keyword to print a field as a user-specified bar code. BARCODE is valid only for Intelligent Printer Data Stream* (IPDS*) printers and only for printer files with device type *IPDS or *AFPDS specified.

The format of the keyword is:

BARCODE(bar-code-ID [height] [[*HRZ | *VRT]
[*HRI | *HRITOP | *NOHRI] [*AST | *NOAST]
[check-digit] [unit-width]
[wide/narrow-ratio]])

The bar-code-ID parameter is required. Valid values for the bar code ID are listed in Table 8.

The height parameter is optional, but if it is specified, it must be the second parameter following the keyword. Valid values for the bar code height are 1 through 9 lines. The value you specify for the bar code height does not include the human readable interpretation below the bar code. If you do not specify the height parameter, the printer uses a default height.

You can specify the last 6 parameters (all optional) in any order. Using these parameters, you can specify that BARCODE:

Note:
The overall barcode width is dependent on:

The width and ratio parameters are ignored for the 4234 and 4224.

For more information about the 4224 printer models, see the 4224 Printer Models 1xx and 2xx Product and Programming Descriptions, GC31-2551.

If you specify an optional parameter that does not apply to the bar code ID you have specified, the printer ignores the optional parameter.

If you attempt to print a bar code on a printer that does not support bar codes, the digits in the code are treated as text, and a diagnostic message results stating that the bar code could not print.

The line and position you specify for the field is used as the upper left corner of the bar code. Because the line specified in the DDS is the base line (the imaginary line on which characters are printed) and this is used as the upper edge of the bar code, the bar code appears to extend down from the bottom of the line you specify.

Table 8 describes valid data types and field lengths for the BARCODE field.

Table 8. Valid Bar Code Definitions

Bar Code ID Data Type Field Length
MSI S 1 through 311
UPCA S 11
UPCE S 10
UPC2 S 2
UPC5 S 5
EAN8 S 7
EAN13 S 12
EAN2 S 2
EAN5 S 5
CODEABAR A 1 through 50
CODE128 A 1 through 50
CODE3OF9 A 1 through 50
INTERL2OF5 S 1 through 31
INDUST2OF5 S 1 through 31
MATRIX2OF5 S 1 through 31
POSTNET S 1 through 31
RM4SCC A 1 through 31
JPBC A 7 through 50
Note:
1 The 4234 Printer only supports 14 digits.

Table 9 describes the supported bar codes.

Table 9. Bar Codes Supported by DDS

BARCODE Digits per Code Range of Characters Allowed Default Check Digits Generated Default Check Digits Printed Valid Check Digits
MSI (changed Plessey) 311 0 through 9 2 Modulus 10 No 01 through 09
UPC-A 11 0 through 9 1 No 00
UPC-E 10 0 through 9 1 No 00
UPC-2 digit add on (must follow a UPC A or E bar code) 2 0 through 9 No No 00
UPC-5 digit add on (must follow a UPC A or E bar code) 5 0 through 9 No No 00
EAN-8 7 0 through 9 1 Yes 00
EAN-13 12 0 through 9 1 Yes 00
EAN-2 digit add on (must follow an EAN 8 or 13 bar code) 2 0 through 9 No No 00
EAN-5 digit add on (must follow an EAN 8 or 13 bar code) 5 0 through 9 No No 00
INDUST2OF5 or industrial 2 of 5 31 0 through 9 1 Yes 01 02
MATRIX2OF5 or matrix 2 of 5 31 0 through 9 1 Yes 01 02
INTERL2OF5 or interleaved 2 of 5 31 0 through 9 1 Yes 01 02
CODEABAR Up to 50 characters 0 through 9,
A through D
(begin/end only),
-, ., $, /, +, and :
1 Yes 01 02
CODE128 Up to 50 characters Refer to Appendix G, CODE128 Character Set in DDS 1 No 012 02
CODE3OF9 or code 3 of 9 Up to 50 characters 0 through 9,
A through Z
(upper case only),
-, ., $, /, +, %,
and a blank
No No 01 02
POSTNET Up to 31 characters 0 through 9 1 Yes Ignored
RM4SCC Up to 31 characters 0 through 9
A through Z
1 Yes Ignored
JPBC Up to 50 characters 0 through 9, A through Z, and - 1 Yes 00 013

Notes:

  1. The 4234 Printer only supports 14 digits.

  2. The value 01 for the check digit is not valid for some printers.

  3. The value 01 provides migration support for application programs that use an AFP font to print Japan Postal Bar Codes. Data written into the field must be valid characters in the AFP font. The application program must also write the start, stop, and check digit characters.

CODEABAR field data must begin with an A, B, C, or D and must end with an A, B, C, or D. For example, A11224455C or D33447799D.

Do not specify BARCODE in the same field with the CHRSIZ, CHRID, CVTDTA, DATE, EDTCDE, EDTWRD, FONT, HIGHLIGHT, PAGNBR, TIME, or UNDERLINE keywords.

See the CVTDTA keyword for information on coding IPDS bar code commands yourself.

If you specify CHRSIZ at the record level, it applies to all fields in that record. If you specify BARCODE in one of those fields, the BARCODE keyword is not allowed.

You cannot specify BARCODE on the same record format with BLKFOLD, CPI, or DFNCHR.

When you specify BARCODE on a numeric field, the number of decimal positions must be zero.

When you specify BARCODE on a constant field, the only valid bar code IDs are CODEABAR, CODE128, and CODE3OF9, and you must also specify the DFT keyword either implicitly or explicitly.

You should specify DEVTYPE (*IPDS) or DEVTYPE(*AFPDS) on the CRTPRTF command when BARCODE is specified in the file.

BARCODE is allowed only on data types S and A (see Table 9 for restrictions).

Option indicators are not valid for this keyword.

Japan Postal Bar Codes (bar-code-ID = JPBC) uses only the bar-code-ID parameter, the bar code print orientation parameter ([*HRZ | *VRT]), and the check digit parameter. All other parameters have predetermined values so any input for them is ignored.

User specified check digits are not validity checked and could cause bar code errors if they are not valid. The Intelligent Printer Data Stream Reference manual contains more information on bar codes and valid check digits.