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.
BARCODE(bar-code-ID [height] [[*HRZ | *VRT]
[*HRI | *HRITOP | *NOHRI] [*AST | *NOAST]
[modifier] [unit-width]
[wide/narrow-ratio]
[PDF417 data]
[Data Matrix data]
[Maxicode data]])
The bar-code-ID parameter is required. You can specify the bar-code-ID parameter as a special alphanumeric value up to 10 characters long, or as a numeric ID. Valid special values for the bar-code ID are listed in Table 1. If you specify a numeric value for the bar-code ID, then you also must specify the bar-code modifier parameter. See the documentation for your printer for the bar-code IDs and modifiers that it supports.
Specify the height in inches or centimeters. When you specify
the height in this way, the valid format is (height *UOM).
Valid values are 0.25 to 25.40 cm (0.10 to 10.00 inches). For PDF417 bar-code
type, valid values are 0.02 to 25.40 cm (0.01 to 10.00 inches). The UOM parameter
on the Create Printer File (CRTPRTF) command determines the unit of measure
for the height.
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 9 parameters (all optional) in any order. Using these parameters, you can specify that BARCODE:
The width and ratio parameters are ignored for the 4234 and 4224 printer models.
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 in stating that the bar code might 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.
The following table describes valid data types, field lengths, and the numeric IDs for the BARCODE field.
| Bar Code ID | Data type | Field length | Numeric ID |
|---|---|---|---|
| MSI | S | 1 through 31 | 2 |
| UPCA | S | 11 | 3 |
| UPCE | S | 10 | 5 |
| UPC2 | S | 2 | 6 |
| UPC5 | S | 5 | 7 |
| EAN8 | S | 7 | 8 |
| EAN13 | S | 12 | 9 |
| EAN2 | S | 2 | 22 |
| EAN5 | S | 5 | 23 |
| CODEABAR | A | 1 through 50 | 13 |
| CODE128 | A | 1 through 50 | 17 |
| CODE3OF9 | A | 1 through 50 | 1 |
| INTERL2OF5 | S | 1 through 31 | 12 |
| INDUST2OF5 | S | 1 through 31 | 10 |
| MATRIX2OF5 | S | 1 through 31 | 11 |
| POSTNET | S | 1 through 31 | 24 |
| POSTNET (PLANET) 5 | S | 1 through 31 | 24 |
| RM4SCC | A | 1 through 50 | 26 |
| AP4SCC | A | 8 through 39 | 31 |
| DUTCHKIX | A | 1 through 50 | 26 |
| JPBC | A | 7 through 50 | 27 |
| PDF417 | A | 1 through 1850 | 30 |
| MAXICODE | A | 1 through 138 | 29 |
| DATAMATRIX | A | 1 through 3116 | 28 |
The following table describes the supported bar codes.
| BARCODE | Digits per code | Range of characters allowed | Default bar code modifier generated | Default bar code modifier printed | Valid bar code modifier |
|---|---|---|---|---|---|
| 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, |
1 | Yes | 01 02 |
| CODE128 | Up to 50 characters | Refer to CODE128 character set in DDS | 1 | No | 012 02 |
| CODE3OF9 or code 3 of 9 | Up to 50 characters | 0 through 9, |
No | No | 01 02 |
| POSTNET | Up to 31 characters | 0 through 9 | 1 | Yes | Ignored |
| POSTNET (PLANET)5 | Up to 31 characters | 0 through 9 | 1 | Yes | 04 |
| RM4SCC | Up to 50 characters | 0 through 9 |
1 | Yes | 00 |
| AP4SCC | 13 through 39 | 0 through 9 |
1 | Yes | 01 through 08 |
| DUTCHKIX | Up to 50 characters | 0 through 9 |
1 | Yes | 01 |
| JPBC | Up to 50 characters | 0 through 9, A through Z, and - | 1 | Yes | 00 013 |
| PDF417 | Up to 1850 characters 4 | Any one-byte character | No | No | 00 01 |
| MAXICODE | Up to 138 characters 4 | Any one-byte character | No | No | 00 |
| DATAMATRIX | Up to 3116 characters 4 | Any one-byte character | No | No | 00 |
| Notes:
|
|||||
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 about coding IPDS bar code commands.
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 2 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 bar code modifier parameter. All other parameters have predetermined values, so any input for them is ignored.
User-specified bar code modifiers are not checked for their validity, and might cause bar code errors if they are not valid. The Intelligent Printer Data Stream™ Reference manual contains more information about bar codes and valid bar code modifiers.
You can specify additional parameters for the two-dimensional barcodes PDF417, Maxicode, and Data Matrix.
(*PDF417 row-size number-rows security
[escape-indicator] [*MACRO(&data-field-name)])
(*MAXICODE symbol-mode [zipper-indicator] [sequence-data])
*SEQUENCE(sequence-indicator total-symbols)
sequence-indicator specifies the structured append sequence indicator. Valid values are 0 - 8.
total-symbols specifies the total number of structured append symbols. Valid values are 2 - 8.
(*DATAMATRIX row-size number-rows [alternate-data-type] [reader]
[header-trailer] [sequence-indicator])
You
can specify the following parameters for the Data Matrix barcode, in the following
order:*SEQUENCE(sequence-indicator total-symbols file-id)
sequence-indicator specifies the structured append sequence indicator. Valid values are in the range of 1 through 16.
total-symbols specifies the total number of symbols that is logically linked in a sequence of symbols. Valid values are in the range of 2 through 16.
file-id specifies a 2-byte unique file identification for a set of structured-append symbols. When specifying the file-id, the format is X'nnnn', where nnnn is the two byte file id in hexadecimal.
The two-dimensional barcodes PDF417, Maxicode, and Data Matrix are ASCII barcodes. The system extracts the CCSID of the job that generates the spool file and translates EBCDIC data to code page 500. The printer then translates the data from code page 500 to the appropriate ASCII code page.
Maxicode and Data Matrix barcodes are assumed to start in ISO 8859-1 code page. The IBM® equivalent is ASCII code page 819. ASCII code page 437 is used for PDF417.
The following example shows how to specify the BARCODE keyword.
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
A FIELD1 11S O 2 4BARCODE(UPCA 6)
A FIELD2 3A 10 6BARCODE(CODE30F9 4 *NOHRI-
A *AST X'02')
A FIELD3 10S O 4 5BARCODE(UPCE 6 (*RATIO 2.75) *HRZ +
A X'00' (*WIDTH .02))
A FIELD4 10A O 5 5BARCODE(CODEABAR 1 (*RATIO 2.1) +
A *HRITOP)
A 6 5'01234567'
A BARCODE(CODE128 2 *HRITOP *HRZ +
A (*WIDTH 0.1) (*RATIO 2) X'01')
A FIELD5 10A 0 12 5BARCODE(CODEABAR (2.0 *UOM))
A FIELD6 10S 0 15 5BARCODE(10 X'01')
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.