Position (positions 42 through 44)

These positions specify the starting position of the field.

The position you specify is based on the value of the characters per inch value for the printer file, which is either specified or implicit in the font being used. If the printer file uses *DEVD for the font, a coded font, or a font character set, text fields are positioned using blanks (x'40') to position to the required columns. Non-text fields, such as barcodes, are positioned using an implied value of 10 CPI. If a proportional spaced font is being used, this might produce columns which do not line up. It is recommended that the Position keyword be used for this situation. The entry must be right-aligned; leading zeros are optional.

If you specify a location of a field in a record and the field is not ignored, you can specify the location of subsequent fields within that record by leaving the line number blank and specifying a plus value (+n) for 42 through 44 (position entry). The plus value indicates the number of spaces to be left between the end of the previous field and the beginning of the field that you are defining. The plus value must be in the range of 0 through 99. If you specify a plus value, the line number entry must be blank. If the plus value causes an implicit space operation and line numbers are not being used for the record format, then skip/space keywords must be used to cause spacing to occur.

The system uses the page width specified on the CRTPRTF command as the width limit when figuring field positions. For example, a user specifies the page width as 132. If the record format being created uses reference positioning instead of hard-coded positions, the fields will be wrapped at position 132. If a line number is specified on a field in the format, the overlapping fields are wrapped to the next line. If no line number is specified for the format, the data is wrapped over the data at the beginning of that same line.

After the positions are calculated, the real values are stored and treated as if they were hard-coded. Therefore, if a field was wrapped and now resides on line 1, position 5, that is where the field remains even if the page width is increased using the CHGPRTF command.

Figure 1 illustrates this problem and two possible solutions (for a page width of 132 characters).

Figure 1. Specify the line and position location
Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
     A*
     A* POSITION PLUS VALUE CAUSES PRFLD1 TO OVERLAP PRFLD2
     A*
     A          R PRTOUT                    SKIPB(1)
     A            PRFLD1       130         1TEXT('START LOC 1,1 END LOC 1,130')
     A            PRFLD2       130        +2TEXT('OVERLAPS PRFLD1')
     A*
     A* SOLUTION 1 TO PREVENT OVERLAP IS TO SPECIFY SPACEA OR SKIPA WITH PRFLD1
     A*   OR TO SPECIFY SPACEB OR SKIPB WITH PRFLD2
     A*
     A          R PRTOUT2                   SKIPB(1)
     A            PRFLD1A      130         1
     A            PRFLD2A      130        +2SPACEB(1)
     A*
     A* SOLUTION 2 PROVIDES A FUNCTIONAL EQUIVALENT NOT USING SKIP/SPACE
     A*
     A          R PRTOUT3
     A            PRFLD1B      130      1  1
     A            PRFLD2B      130        +2
     A

If FOLD(*YES) is specified for the CRTPRTF, CHGPRTF, or OVRPRTF command, any field that extends beyond the end of a line is continued on the next line. The break occurs at the end of the line but you can cause it to be folded at a blank by specifying the BLKFOLD keyword. If FOLD(*NO) is in effect, a field that extends beyond the end of a line is truncated.

The data description specifications determine which fields appear on the same print line. The data description processor diagnoses overlap at file creation time. Keywords or fields containing optional keywords are assumed to be selected. Therefore, no overlap check is made for the cases in which the keywords or fields are not selected. In Figure 2, no fields will overlap unless indicator 01 is on, in which case F1, F3, and F4 will overlap. A diagnostic is sent for the format indicating that field selection or conditioning of space/skip keywords can cause fields to overlap at run time.

On some printers, printer throughput speed is better when fields on the same line are specified in the DDS in right-to-left order.

Figure 2. Overlapping fields
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
     A*
     A* OVERLAPPING FIELDS ONLY IF IND 01 IS ON
     A*
     A          R REC1                      SKIPB(1)
     A            F1             1         1
     A NO1        F2             1         1SPACEB(1) SPACEA(1)
     A            F3             1         1
     A            F4             1         1
     A NO1                                  SPACEB(1)
     A