Here is an
open source barcode producing application implemented in Java. It consumes a relatively simple XML document and produces DataMatrix barcodes (among others), encoded as another XML document, called SVG. It is also capable of producing other graphics formats, but does not directly produce PCL.
To get PCL, one could embed the SVG inside
another XML document called XSL Formatting Objects (XSL-FO). XSL-FO can then be rendered as PDF, PCL, and several other formats using a Formatting Object Processor, and example of which is Apache FOP (Google it).
DataMatrix is quite complicated when compared to PostNet, 4-state, EAN/UPC, Code 128, etc, since it is a two dimensional code.
You could do a couple things with this information.
1. You could decide to write a very simple XML document using line sequential and process it through barcode4j and Apache FOP, and 'inhale' the resulting PCL, or ...
2. You could use the open source barcode4j as a template for an algorithm to be reimplemented in COBOL. After all, the algorithm is merely deciding where to draw rectangles. If you are fluent with PCL, this might work.
Too bad you are not using a different COBOL, where this could be done in three or four lines of procedure code!
Tom Morrison