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 rules for field processing of data files are:

  • Each record in your file must correspond to a separate PRINTLINE command because each record is mapped separately. When processing identical fields, you can define a single printline and use the REPEAT subcommand.
  • Each FIELD command must follow its associated PRINTLINE command, and more than one FIELD command can be specified for a single PRINTLINE 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 ;
 PRINTLINE POSITION 1 IN 1 IN ; /*PROCESSING FOR R1              */
  FIELD START 1 LENGTH 4 ;      /*THE PRINTLINE POSITION IS      */
                                /*THE DEFAULT FOR THE FIRST FIELD*/
  FIELD START 11 LENGTH 4
        POSITION 4 IN 0 IN ;
 PRINTLINE POSITION 3 IN 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 ;
 PRINTLINE POSITION 1 IN 2 IN ; /*PROCESSING FOR R3              */
  FIELD START 1 LENGTH 4 ;      /*DEFAULT POSITION               */
  FIELD START 11 LENGTH 4
        POSITION 4 IN 0 IN ;

Unformatted Print Data File

Unformatted Print Data File

Data Arranged on the Printed Page

Data Arranged on the Printed Page