Printing Fields in Two Directions on the Same Page

This example is similar to Figure A Printout with More Than One Line Direction, 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 LAYOUT commands:

LAYOUT 'abc' POSITION LEFTMARGIN TOPMARGIN NEWPAGE;
  FIELD START 1 LENGTH 4 ;
LAYOUT 'def' POSITION 2 IN ABSOLUTE 4 IN ;
  FIELD START 7 LENGTH 4
        DIRECTION UP ;

As expected in field processing, FIELD commands are nested within LAYOUT commands. Figure Field Direction 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 layouts 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 LAYOUTs of this page definition format as many records as are presented, two to a page, on pages 1 through n.

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

Note: The data area of this example does not show the Record ID.

Field Direction

Field Direction