Processing Fields

This section describes the mapping of individual fields to the printed sheets. The technique allows you to print unformatted data according to precise specifications, and these specifications can change without affecting the data file.

The rule for field processing of data files is: Each FIELD command must follow its associated LAYOUT command, and more than one FIELD command can be specified for a single LAYOUT command.

For this field-processing example, the data file shown in the next figure is used. Figure Data Arranged on the Printed Page represents an output format that could be used to place data on a form, such as an invoice or an order. The page definition commands to print Figure Data Arranged on the Printed Page are as follows:

PAGEDEF ABCD
        WIDTH 7 IN
        HEIGHT 8 IN ;
FONT GS12 GS12;
LAYOUT 'abc' POSITION 1 IN ABSOLUTE 1 IN ; /*PROCESSING FOR R1   */
  FIELD START 1 LENGTH 4 ;      /*THE LAYOUT POSITION IS         */
                                /*THE DEFAULT FOR THE FIRST FIELD*/
  FIELD START 11 LENGTH 4
        POSITION 4 IN 0 IN ;
 LAYOUT 'def' POSITION 3 IN ABSOLUTE 4 IN ; /*PROCESSING FOR R2  */
  FIELD START 1 LENGTH 4 ;      /*DEFAULT POSITION               */
  FIELD START 6 LENGTH 4
        POSITION 0 IN 1 IN ;
  FIELD START 13  LENGTH 3
        POSITION 2 IN 3 IN ;
 LAYOUT 'ghi' POSITION 1 IN ABSOLUTE 2 IN ; /*PROCESSING FOR R3  */
  FIELD START 1 LENGTH 4 ;      /*DEFAULT POSITION               */
  FIELD START 11 LENGTH 4
        POSITION 4 IN 0 IN ;

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

Unformatted Print Data File

Unformatted Print Data File

Data Arranged on the Printed Page

Data Arranged on the Printed Page