Printing Fields in Two Directions on the Same Page

This example is similar to Figure Printing Lines in Two Directions on a Page, except that you learn how to control direction field by field. This method creates a field-processing page definition and places direction controls in the FIELD commands. This command stream contains a portion of the page definition controls, showing only the PRINTLINE commands:

PRINTLINE POSITION MARGIN TOP ;
  FIELD START 1 LENGTH 4 ;
PRINTLINE POSITION 2 IN 4 IN ;
  FIELD START 7 LENGTH 4
        DIRECTION UP ;

As expected in field processing, FIELD commands are nested within PRINTLINE commands. The next figure shows a simplified portion of an unformatted file and two pages of the printout formatted by the page definition, part of which is shown in the command stream. Two printlines are specified because the data file contains two input record formats (1 and 3 are alike; 2 and 4 are alike) and because the fields are mapped to two different positions in the output. The assumption of this sample is that the data file is actually much longer than the portion shown. If, however, the records in the file alternate in format as the first four do, the two PRINTLINEs of this page definition formats as many records as are presented, two to a page, on pages 1 through n.

If more than two record mappings are required by the print job, more than two PRINTLINE commands are required in the page definition.

Field Direction

Field Direction