PAGSEG (Page Segment) keyword in printer files

You use this record-level keyword to print a page segment.

The format of the keyword is:

PAGSEG(library-name | &library-name-field/ page-segment-name | 
       &page-segment-name-field
       position-down | &position-down-field
       position-across | &position-across-field
       [(*SIZE height | height-field width | &width-field)]
       [(*ROTATION rotation | &rotation)]                   

The page-segment-name, position-down, and position-across parameters are required.

Use the optional library-name parameter to further qualify the page segment. If you do not specify the library name, *LIBL is used to search for the page segment at print time.

Note: If an application uses private resources (for example, fonts, page segments, overlays, or GDF files not distributed with the system), be aware of the following. When referencing these resources, if you specify *LIBL or you do not specify a library name, the resources must be available through the library list used by the application creating the spooled file.

You can specify the library-name, page-segment-name, position-down, position-across, width, height and rotation parameters as constants, program-to-system fields, or a combination of both, as shown in the following examples:

  • [library-name/]page-segment-name...
  • [library-name/]&field1...
  • [&field2/]page-segment-name...
  • [&field3/]&field4...

When you specify the library-name as a program-to-system field, the field must exist in the same record format as the PAGSEG keyword. It must be defined as length of 10, data type A (character), and usage P (program-to-system).

When you specify the page-segment-name as a program-to-system field, the field must exist in the same record format as the PAGSEG keyword. It must be defined as length of 8, data type A (character), and usage P (program-to-system).

When you specify the position-down, position-across, width, or height parameters as program-to-system fields, the fields must be defined as length 5 with 3 decimal positions, data type S, and usage P. Rotation must be defined as length with 3 and 0 decimal points, data type S and usage P.

The position-down parameter defines the vertical starting point of the page segment relative to the margins specified on the FRONTMGN or BACKMGN parameter on the CRTPRTF command. Valid values are 0 to 57.790 cm (0 to 22.750 in.).

The position-across parameter defines the horizontal starting point of the page segment relative to the margins specified on the FRONTMGN or BACKMGN parameter on the CRTPRTF command. Valid values are 0 to 57.790 cm (0 to 22.750 in.).

Note: The UOM parameter on the CRTPRTF command determines the units of measure for the position-down and position-across parameter values. If the value specified for a parameter is outside the valid range, it is flagged when the spooled file is created.

An error message is issued at print time if the page segment does not fit on the page.

Use the optional height and width parameters to specify the size of the page segment. They are specified as an expression of the form (*SIZE height width). If these parameters are omitted, then the size of the page segment is not changed (the page segment prints with the size it was originally created with).

The optional height parameter defines the height of the page segment. Valid values are 0.001 to 57.790 cm (0.001 to 22.750 in.). If the height is specified, then the width parameter must also be specified.

The optional width parameter defines the width of the page segment. Valid values are 0.001 to 57.790 cm (0.001 to 22.750 in.). If the width is specified, then the height parameter must also be specified.

The optional rotation parameter allows you to specify a rotation value for the page segment. It is specified as an expression of the form (*ROTATION rotation). Valid values are 0, 90, 180 and 270.

Note: If the rotation parameter is omitted, then page segments are not automatically rotated when using the PAGRTT parameter on the printer file. Feature Print Services Facility™ (PSF) is required for use of this keyword.

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

When PAGSEG is specified on a record format, all fields within the record format must be positioned using the POSITION keyword.

An error message is issued if a constant field is specified in a record format where the PAGSEG keyword is also specified.

You can specify the PAGSEG keyword multiple times on a record.

A maximum of 10 page segments can be used per page.

Page segments are not automatically rotated when using the PAGRTT keyword or the PAGRTT parameter on the printer file. See the iSeries Guide to Output Link to PDF book for information about page segments .

You cannot specify PAGSEG at the same level as the following keywords:

  • SPACEA
  • SPACEB
  • SKIPA
  • SKIPB

Option indicators are valid for this keyword.

Example 1

The following example shows how to specify the PAGSEG keyword.

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
     A*
     A          R REC1                      PAGSEG(MYLIB/PAGSEG5 3.527 4.162)
     A*
     A          R REC2                      PAGSEG(&LIB/&PSEG &POSD &POSA);
     A            LIB           10A  P
     A            PSEG           8A  P
     A            POSD           5S 3P
     A            POSA           5S 3P
     A*
     A          R REC3                      PAGSEG(MYSEG 0.0 3.759)
     A                                      PAGSEG(YOURSEG 0.0 5.233)
     A*
     A          R REC4
     A  01                                  PAGSEG(MYSEG 0.0 3.01)
     A*
     A
Note: The UOM parameter on the CRTPRTF command determines the units of measure for the parameter values.

REC1 prints page segment PAGSEG5 found in library MYLIB. The page segment prints 3.527 units down and 4.162 units across from the margins specified on the FRONTMGN or BACKMGN parameter on the CRTPRTF command.

REC2 allows the application program to specify the library by setting field LIB and specify page segment name by setting field PSEG. The application specifies the page segment position at run time by setting POSD and POSA.

REC3 prints two page segments. MYSEG prints 0 units down and 3.759 units across from the margins specified on the FRONTMGN or BACKMGN parameter on the CRTPRTF command. YOURSEG prints 0 units down and 5.233 units across from the margins specified on the CRTPRTF command. Both page segments are located using *LIBL.

REC4 prints MYSEG only if indicator 01 is on.

Example 2

The second example uses DDS and P-fields.

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
      *
                R REC1                      PAGSEG(&MYLIB/&PAGSEG   +
                                            &OFFD &OFFA
      *
                  MYLIB         10A  P
                  PAGSEG         8A  P
                  OFFD           5S 3P
                  OFFA           5S 3P

The following graphic illustrates the location of the page segment using the previous DDS code. The application program specifies the library by setting field MYLIB and specifies the page segment name by setting field PAGSEG. The application program also sets a value of 2 in field OFFD and a value of 2 in field OFFA. Both the FRONTMGN and BACKMGN parameters on the CRTPRTF command are set to 2.

An illustration of the results produced by Example 2.