Printing Line Data on a Print Server Printer

This example shows how you can print a data file developed for a line printer on a page printer without altering the data. The example compares the effects of line printer controls with the corresponding controls in the PPFA commands and subcommands. PRINTLINE, LINESP, POSITION, CHANNEL, and REPEAT are page definition controls related to the lines of text in your printout. Line printer controls examined are the forms control buffer (FCB) and carriage control characters.

As shown in Figure Line-Data File, a file consisting of 13 records is to be printed. Several different printouts of this data are formatted in the following examples. In the first two printouts, records 1–6 are printed on page 1, records 7–9 on page 2, and records 10–13 on page 3.

Line-Data File

Line-Data File

Figure Data File Printed on a Line Printer shows the formatting process used when the file is printed on a line printer. For many line printers, an FCB is used to format the output in the S/370 (OS/390 and z/OS, VM, VSE) environment. The sample FCB represented in Figure Data File Printed on a Line Printer determines that no printed page contain more than eight lines. A page can have exactly eight lines without using carriage control characters in the data. A page may contain any number of lines fewer than eight; this is effected by placing fewer than eight records between the carriage control characters in the data. In the data file in data file in the previous figure, fewer than eight records are, in all cases, placed between channel 1 carriage control characters. A ninth record, if encountered before a carriage control character, would cause a page eject and a return to the beginning of the FCB. The printout shown in FigureData File Printed on a Line Printer results from the data being formatted by this FCB.

Data File Printed on a Line Printer

Data File Printed on a Line Printer

A page definition can work exactly the same way. Consider the following example:

SETUNITS 1 IN 1 IN
         LINESP 6 LPI  ;
PAGEDEF ABCD
        WIDTH 5
        HEIGHT 7
        LINEONE .5 .5  ;
  PRINTLINE CHANNEL 1
            POSITION MARGIN TOP
            REPEAT 8 ;

This command stream contains one new command (PRINTLINE) and four new subcommands (LINESP, CHANNEL, POSITION, and REPEAT) related to controlling individual lines.

  • The LINESP subcommand has the same function as the LPI specifications in the FCB or in a Printer File; it defines the line density in lines per inch.
  • The PRINTLINE command contains the controls for one or more lines.
  • The CHANNEL subcommand has the same function as the channel 1 control character in the FCB, causing a page eject at each channel 1 control character encountered in the data records.
  • The POSITION subcommand establishes the location of the first line relative to the upper-left corner of the logical page. This example uses the MARGIN and TOP parameters; however, numeric parameters similar to those used with the OFFSET subcommand can also be used. Those values are also relative to the logical page.
  • The REPEAT subcommand is a commonly used control in PPFA text formatting. It is the way you specify the total number of PRINTLINEs in a logical page.
    Note: The constraints in specifying a REPEAT value and, thereby, the number of lines per page are: the lines-per-inch specification, the height of the logical page, and the font selection. The REPEAT variable 8 is chosen to equal the maximum number of records to be printed per page. As in the line printer version, if a ninth record were encountered before a channel 1 carriage control character, a page eject would occur and the line would be printed as the first line at the top of the next page.

The result of this page definition is represented in the next figure.

Printout Examples Specifying POSITION MARGIN TOP

Printout Examples Specifying POSITION MARGIN TOP

Changing line printing specifications for the following example is shown in Figure Printout Example Specifying POSITION MARGIN 4.1 .

Printout Example Specifying POSITION MARGIN 4.1

Printout Example Specifying POSITION MARGIN 4.1

SETUNITS 1 IN 1 IN
         LINESP 6 LPI ;
PAGEDEF ABCD
        WIDTH 5
        HEIGHT 7
        LINEONE .1 .1  ;
  PRINTLINE CHANNEL 1
            POSITION MARGIN 4.1
            REPEAT 8 ;

Observe that the second parameter of POSITION is no longer TOP; instead it is 4.1, which places the first line of text 4.1 inches down the page rather than at the top.

Printout Example Specifying POSITION MARGIN TOP and POSITION MARGIN 4.1

Printout Example Specifying POSITION MARGIN TOP and POSITION MARGIN 4.1

The following example and the previous figure show a third version of the possible formats for the data represented in Figure Data File Printed on a Line Printer.

SETUNITS 1 IN 1 IN
         LINESP 6 LPI ;
PAGEDEF ABCD
        WIDTH 5
        HEIGHT 7
        LINEONE .1 .1 ;
  PRINTLINE CHANNEL 1
            POSITION MARGIN TOP
            REPEAT 8 ;
  PRINTLINE CHANNEL 1
            POSITION MARGIN 4.1
            REPEAT 8 ;

You also can skip over space using carriage control characters. This example shows how to do this by using a second PRINTLINE command to create a second starting position on the page. The second starting position is vertically 4.1 inches down from the top of the page; see the second POSITION subcommand. The two CHANNEL 1 subcommands take turns mapping the records governed by the successive channel 1 carriage control characters in the data to their specified positions on the page. In this case, the carriage control 1 characters cause printing to alternate between the TOP position (0.1 inch down the page) and 4.1 inches down the page.