Macro Definitions

This section of a PDF contains user-defined macros. A macro is a single mnemonic that stands for a control code or a sequence of control codes. A mnemonic simplifies defining control sequences for PC printers and makes it easier to read the information in the PDF.

The following table shows the structure of a macro definition statement. A macro definition is composed of four parts:

1 2 3 4
name EQU PC Printer Control Codes Comments

For example:

   FFF    EQU   0C               /* Form Feed */

The first part is the user-defined mnemonic or macro name. This name must be exactly three characters long and must not begin with a number. It is helpful to define a meaningful mnemonic, such as P17 for 17.1 pitch.

The second part, EQU, stands for equate and must be coded as EQU.

The third part is the hexadecimal control code, which is specific to a PC printer. Each PC printer manufacturer can define different control codes for the same printer function. For example, the IBM® 4019 LaserPrinter uses control codes defined by the IBM Personal Printer Data Stream (PPDS). Hewlett-Packard printers use control codes defined by the Hewlett-Packard Printer Control Language (PCL). These control codes are usually defined in the manual that comes with the printer.

Some PC printer manuals describe control sequences as a string of ASCII symbols, such as ESC J 1 K: others use hexadecimal numbers, such as 1B 57 01; while others use decimal values, such as 27 28 1. The printer definition table compiler accepts any of these formats.

The control codes in the macro definitions section can be any of the following:

If you leave the control code section blank or if you delete it, the character or control code is interpreted as a null string. If a character or control code is defined more than once in the file, the last definition is used.

The fourth part is the comment section. The symbols /* indicate the beginning of a comment and the symbols */ indicate the end of a comment. Comments can be coded at any point in the printer definition file and are ignored by the printer definition table compiler.

The following is an example macro definition statements that are specific to the IBM 4019 LaserPrinter.

LFF EQU 0A                       /* Line Feed                  */
VTB EQU 0B                       /* Vertical Tab                */
FFF EQU 0C                       /* Form Feed                   */
CRR EQU 0D                       /* Carriage Return             */
P05 EQU 1B 57 01                 /* 5 Pitch-Characters/inch     */
P10 EQU 12                       /* 10 Pitch-Characters/inch    */
CDW EQU 1B 57 00                 /* Cancel Double Wide contin.  */
P17 EQU 12 0F                    /* 17.1 Pitch-Character/inch   */
LL8 EQU 1B 41 09 1B 32           /* Set line length 8 lines/inch*/
P12 EQU 1B 3A                    /* 12 Pitch-characters/inch    */
RES EQU 1B 5B 4B 07 00 05 31 01 A4 00 00 90
                                 /* The above macro resets the  */
                                 /* printer using the factory   */
                                 /* defaults.  See the IBM Laser*/
                                 /* Printer Technical Reference */
                                 /* manual.                     */

To illustrate how macros are coded, consider this example. To have the host print job printed in double-wide characters, you must know what control code turns on double-wide printing on your PC printer. On the IBM 4019 LaserPrinter, the control code to turn on double-wide printing is X'1B5701'. This would be coded as:

BDW EQU 1B 57 01

where BDW stands for Begin Double Wide.

This alone would not cause 3270 host print to send this control to the printer. The mnemonic would have to be included in a control code statement, such as START_JOB which is described in the control codes section of the file.

Note: The IBM 4019 LaserPrinter printer definition file that comes with HCL Z and I Emulator for Windows already has this control code defined as the P05 macro. See line 9 of the sample IBM 4019 LaserPrinter Macro Definition Statements (IBM4019.PDF File Contents).