Start of change

RELPOS (Relative Position) keyword in printer files

Use this file-level keyword to indicate that when the +n form of positioning a field is used, the fields subsequent to the first field in the line are positioned relative to the end of the previous field. Without the RELPOS keyword, the column number calculated at compile time is generally relative to the beginning of the line.

This keyword has no parameters.

The +n positioning means that, 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 position entry 42 through 44. The plus value indicates the number of spaces to be left between the end of the previous field and the beginning of the field 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. As soon as the positions are calculated, the real values are stored and treated as if they were hard-coded. This is a compile time function.

Specify DEVTYPE (*AFPDS) on the CRTPRTF command when RELPOS is specified at the file level. If DEVTYPE is changed to anything other than *AFPDS, the keyword is ignored and a warning message is issued at print time.

Option indicators are not valid for this keyword.

Note: The Print Services Facility™ (PSF) feature is required for printing DEVTYPE (*AFPDS) files on an IPDS™ printer.
Table 1.
Condition Cases
1 2 3 4 5 Else
Was the file-level keyword RELPOS used? Y Y Y N N  
Was +n positioning used? Y Y N Y N  
Was the file-level font width not known?1     Y Y Y  
Did the previous field on the line use a file-level font?     Y Y Y  
Were there no DBCS characters in the previous field?     Y Y Y  
Is the new column number greater than the current column number? Y N Y Y Y  
Runtime result:
The new field is offset from the end of the previous field. Y   Y Y Y  
The new field is positioned from the beginning of the line.   Y       Y
1If the printer file FONT parameter is *DEVD, or the printer file has a FNTCHRSET or CDEFNT specified at the file level, the file-level font width is not known.

Example

The following example shows how to specify the RELPOS keyword.

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8

     A*                                                                  
     A                                      RELPOS                       
     A          R REC1                      FONT(1051)
     A*                                      (1051 specifies Sonoran Serif)
     A            FLD1           5A     1 10                             
     A            FLD2           5A       +2                             
     A*                                               

FLD2 is placed two spaces to the right of the end of FLD1. Depending on the width of the characters used in FLD1, the start of FLD2 might vary. Without the RELPOS keyword, FLD2 is placed in column 17 of the line; the exception to this statement is noted in columns 3 through 5 of the previous table.

End of change