Eric Sorensen of HP says:
I am not a COBOL expert, but often I assist customers with PCL for barcodes, and the following is a typical example of how they select 3of9 barcode in COBOL and then send barcode data to the printer:
+
BARCODE.
FILLER PIC X VALUE %33 (this is the escape)
FILLER PIC X(3) VALUE "(0Y" (select 3of9)
BARCODE PIC X(13) VALUE "*12345*" ("12345" is barcode data; asterisks are required for start/stop characters-- also called framing characters)
then they do some "move" commands to fill the variables with data (I assume), and then "write" those to the printer. The printer will continue to print barcodes with each "write" until you select a new primary character set with this (or similar) command (to select "Roman8 character set): esc(8U or in COBOL:
FILLER PIC X VALUE %33 (this is the escape)
FILLER PIC X(3) VALUE "(8U" (select Roman8)
You may send PCL commands to printers at any point in the printfile. With a LaserJet you may mix PCL commands in the text, but HP lineprinters cannot mix text and barcodes on the same line, unless you can do a carriage return without a linefeed. HP lineprinters do not use the same set of escape sequences as Laserjets.