Duplex Output with Different Front and Back Print Directions

This example shows how to establish one print direction on the front side and a different print direction on the back side of a duplex sheet.

The page definition in this example contains two page formats, each of which has a CONDITION statement that always returns a true value. The value is true because the character in position 1 always has a value greater than or equal to hexadecimal zero. Therefore, every time a page change occurs (front to back, or back to next front) a different page format is started. The different DIRECTION statements in the two page formats change the layout of the text on the page.

Observe that the COPYGROUP parameter is specified as NULL. If a parameter other than NULL or / is specified for COPYGROUP, the copy group restarts every time a page change occurs. Because restarting a copy group forces data to a new sheet, duplex printing does not occur.

Example of Duplex Output

FORMDEF XMPDUP
        DUPLEX NORMAL;
 
PAGEDEF XMPDUP WIDTH 8.5  HEIGHT 11.0;
  PAGEFORMAT  P2FRONT DIRECTION ACROSS;
    PRINTLINE CHANNEL 1 POSITION   0.75   TOP;
      CONDITION GOTOBACK START 1 LENGTH 1
        WHEN GE X'00'  AFTER SUBPAGE NULL  PAGEFORMAT P2BACK;
    PRINTLINE REPEAT 59;
 
  PAGEFORMAT  P2BACK DIRECTION UP;
    PRINTLINE CHANNEL 1 POSITION   0.25   TOP;
      CONDITION GOTOFRNT START 1 LENGTH 1
        WHEN GE X'00'  AFTER SUBPAGE NULL PAGEFORMAT P2FRONT;
    PRINTLINE REPEAT 59;